Open mjmcgrath2010 opened 1 month ago
In Node 20.10.0 the import syntax's changed from import ... assert
to import ... with
. You can either upgrade Node to 20.10.0 or downgrade adminjs
to 7.8.1.
Do note that the current LTS version is 20.15.1. I'll update package.json to explicitly say that node
version must be greater or equal 20.10.0.
While I agree that Node's implementation of ESM is not the best, we'd been forced to migrate ourselves due to our dependencies abandoning CJS.
Contact Details
mike@grocerslist.com / engineering@grocerslist.com
What happened?
SyntaxError: Unexpected token 'with' when upgrading Node to
v20.9.0
andadminjs@7.8.7
I cannot boot my server due to a syntax error stemming from this file:
My
tsconfig.json
is proper and adheres to documentation, using esm & nodenext, etc..., however, it seems like this forward-looking vision of "ESM is the new future" may hold true, but sadly, it appears that is indeed not the case forwith { type: 'json' }
syntax sad to report.Can this be fixed as soon as possible? This package pushes everyone to adhere to ESM, a new and actively changing spec, as opposed to CJS, which has been battle-tested for years with wide support, presumably to be on the "cutting edge of an envisioned future." --- IMO, it is pretty frustrating for an npm package to have control over how I want my modules to be implemented already; the least you can do is ensure that YOUR forward-thinking package adheres to the everchanging ecosystem. Sorry to be blunt, I find this wild.
If we can get this resolved within the next couple of months we'd still be interested in the enterprise version, but if not, it's worth the headache, honestly.
Bug prevalence
Its your bug
AdminJS dependencies version
"typescript": "^5.4.5"
What browsers do you see the problem on?
Firefox, Chrome, Safari, Microsoft Edge
Relevant log output
Relevant code that's giving you issues