You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 file proxy.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 this
{__esModule: true,default: {
... // options}}
The 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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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