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
{{ message }}
Repository navigation
Migrate from import assertion to import attribution #11
SyntaxError: Unexpected identifier 'assert'
at compileSourceTextModule (node:internal/modules/esm/utils:337:16)
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:166:18)
at callTranslator (node:internal/modules/esm/loader:436:14)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:442:30)
SyntaxError: Unexpected identifier 'assert'
at compileSourceTextModule (node:internal/modules/esm/utils:340:16)
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:102:18)
at #translate (node:internal/modules/esm/loader:433:12)
Activity
RomainLanz commentedon Sep 2, 2024
Hey @codmajik! 👋🏻
I am not sure I understand the table correctly, does that mean we can freely use the
withsyntax in older Node.js versions?guledali commentedon Sep 26, 2024
I'm getting this as well
Node.js v22.3.0dmazoli commentedon Sep 29, 2024
Same here, trying to run upgrade-kit at an adonis 5.8.0 project.
`
npx @adonisjs/upgrade-kit upgrade-packages --path={{pathToProject}}
file:///usr/local/lib/node_modules/@adonisjs/upgrade-kit/node_modules/@adonisjs/ace/build/src/helpers.js:3
import schema from '../schemas/command_metadata_schema.json' assert { type: 'json' };
^^^^^^
SyntaxError: Unexpected identifier 'assert'
at compileSourceTextModule (node:internal/modules/esm/utils:337:16)
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:166:18)
at callTranslator (node:internal/modules/esm/loader:436:14)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:442:30)
Node.js v22.7.0
`
zakariamehbi commentedon Oct 2, 2024
Working like a charm with the LTS version of node.
CodeSyncr commentedon Nov 11, 2024
+1
file:///Users/yashkumar/.npm/_npx/632aa895c0dbb5b6/node_modules/@adonisjs/ace/build/src/helpers.js:3
import schema from '../schemas/command_metadata_schema.json' assert { type: 'json' };
^^^^^^
SyntaxError: Unexpected identifier 'assert'
at compileSourceTextModule (node:internal/modules/esm/utils:340:16)
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:102:18)
at #translate (node:internal/modules/esm/loader:433:12)
CodeSyncr commentedon Nov 11, 2024
Temporary solution would be nvm use 21
motephyr commentedon Jan 20, 2025
I changed the code
to
skip the warning.
leocabeza commentedon Jun 26, 2025
Can anyone share what node version worked for you to bypass this error?
Edit: for future self and others: I switched from yarn to pnpm and fixed this issue
motephyr commentedon Jun 27, 2025
I use Node.js v22