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
There is an error in the CJS code generated for netlify-adapter where line 6 of .netlify/handler.js ends up as...
var ./server/app.js = require('./server/app.js');
...which is a syntax error and leads to bad deploy unless you force esbuild to be used instead. The CJS version of handler.js (before code replacements take place) looks like...
var APP = require('APP');
...whereas the ESM version looks like...
import { App } from 'APP';
The code substitution is based on replacing APP with ./server/app.js (lines 53-55 of adapter-netlify/index.js) so mistakenly replaces both uses within the require statement (the variable and the path).
It looks like rollup is altering the import from App to APP when it changes it to a require statement for CJS.
In addition it looks like the adapter is hardcoded to build CJS functions targeted for node 12...
* give module id an invalid name to prevent invalid replacement - fixes#3526
* changeset
* Update packages/adapter-netlify/index.js
* Update packages/adapter-netlify/index.js
There is an error in the CJS code generated for netlify-adapter where line 6 of
.netlify/handler.js
ends up as......which is a syntax error and leads to bad deploy unless you force esbuild to be used instead. The CJS version of
handler.js
(before code replacements take place) looks like......whereas the ESM version looks like...
The code substitution is based on replacing
APP
with./server/app.js
(lines 53-55 ofadapter-netlify/index.js
) so mistakenly replaces both uses within the require statement (the variable and the path).It looks like rollup is altering the import from
App
toAPP
when it changes it to a require statement for CJS.In addition it looks like the adapter is hardcoded to build CJS functions targeted for node 12...
...rather than something newer or respecting netlify.toml
Originally posted by @goynang in #2687 (comment)
The text was updated successfully, but these errors were encountered: