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
Currently the docs are not complete, as building the site per the contributor docs does not work in neither Node 20 nor Node 22. I conferred the engines spec and it does not reflect reality:
Stating the working versions and/or having a Github workflow that builds the site using all LTS versions of Node would be a start in fixing this.
Results of building
Node 20.9.0
npx yarn start
yarn run v1.22.22
$ yarn up-to-date-check && env-cmd --silent cross-env CONTENT_ROOT=files REACT_APP_DISABLE_AUTH=true BUILD_OUT_ROOT=build yar
i-server
$ node scripts/up-to-date-check.js ir current behavior and syntax as those might change in a future version of Node.js.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:80436) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
file:///Users/carlerik/dev/mdn-content/node_modules/compute-baseline/dist/browser-compat-data/compat.js:1
import bcd from "@mdn/browser-compat-data" with { type: "json" };
^^^^
SyntaxError: Unexpected token 'with'
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:118:18)
at callTranslator (node:internal/modules/esm/loader:273:14)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:30)
Node.js v20.9.0
error Command failed with exit code 1.
Node.js v20.9.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Node 22.8
npx yarn start
yarn run v1.22.22
$ yarn up-to-date-check && env-cmd --silent cross-env CONTENT_ROOT=files REACT_APP_DISABLE_AUTH=true BUILD_OUT_ROOT=build yar
i-server
$ node scripts/up-to-date-check.js ir current behavior and syntax as those might change in a future version of Node.js.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:80436) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
file:///Users/carlerik/dev/mdn-content/node_modules/compute-baseline/dist/browser-compat-data/compat.js:1
import bcd from "@mdn/browser-compat-data" with { type: "json" };
^^^^
SyntaxError: Unexpected token 'with'
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:118:18)
at callTranslator (node:internal/modules/esm/loader:273:14)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:30)
Node.js v20.9.0
error Command failed with exit code 1.
Node.js v20.9.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
* Remove deprecated 'assert' import syntax in favor of 'with'
fixes#35825
* Set minimum Node version in `.engines` field to 18.20.0
This is the minimum version that supports the new `import ... with`
syntax.
Currently the docs are not complete, as building the site per the contributor docs does not work in neither Node 20 nor Node 22. I conferred the
engines
spec and it does not reflect reality:Stating the working versions and/or having a Github workflow that builds the site using all LTS versions of Node would be a start in fixing this.
Results of building
Node 20.9.0
Node 22.8
Some analysis
I see that the
assert
syntax failing the Node 20 build is deprecated and removed in Node 22, so I can try fixing that script.The text was updated successfully, but these errors were encountered: