Replies: 1 comment 4 replies
-
I tried changing the file type to .mjs, however, my proxy settings after the file type changes are just being ignored! Which builder do you use? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Originally opened/closed here (without resolution) #9266
This is more of a PSA/help for any poor soul in the future who runs into this.
I had upgrade my node server to the LTS (22.13.0) when I noticed this bug happening. I'm using Angular 19 with a proxy config file that had previously worked with Node 20.
Upon inspection, I had specifically been using an ES module format (
export default {...}
) with my fileproxy.config.js
which was passed along to Vite. However, somewhere in the process, because this was being treated as a module, the "object" that was returned/passed to Vite was like thisThe options that should have been passed to vite were inside the
default
property, but when vite started parsing the module as a whole, it got held up at the__esModule
boolean, which ultimately caused the problem.The resolution for me was to rename the config file to use the
.mjs
extension. Alternatively I could have used the.json
extension, but because I needed function definitions, I required.mjs
.Beta Was this translation helpful? Give feedback.
All reactions