[commonjs] Unexpected token

Hi šŸ™‚ I'm working on a Discord integration for Foundry VTT, and I'm having an issue with getting discord.js to play nice with my toolchain. I'm getting this error when I try to build:
yarn run v1.22.19
warning package.json: "dependencies" has dependency "discord.js" with range "^14.13.0" that collides with a dependency in "devDependencies" of the same name with version "^14.11.0"
warning ../../../../package.json: No license field
$ tsc && vite build --watch
1
vite v3.1.0 building for production...

watching for file changes...

build started...
āœ“ 2455 modules transformed.
[commonjs] Unexpected token
file: ~/Documents/dev/foundry/foundry-ai-dev/node_modules/discord.js/src/client/actions/InteractionCreate.js:430:8
428: route;
429: majorParameter;
430: global;
^
431: constructor({ timeToReset, limit, method, hash, url, route, majorParameter, global }) {
432: super();
transforming (3053) node_modules/@discordjs/voice/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCo
yarn run v1.22.19
warning package.json: "dependencies" has dependency "discord.js" with range "^14.13.0" that collides with a dependency in "devDependencies" of the same name with version "^14.11.0"
warning ../../../../package.json: No license field
$ tsc && vite build --watch
1
vite v3.1.0 building for production...

watching for file changes...

build started...
āœ“ 2455 modules transformed.
[commonjs] Unexpected token
file: ~/Documents/dev/foundry/foundry-ai-dev/node_modules/discord.js/src/client/actions/InteractionCreate.js:430:8
428: route;
429: majorParameter;
430: global;
^
431: constructor({ timeToReset, limit, method, hash, url, route, majorParameter, global }) {
432: super();
transforming (3053) node_modules/@discordjs/voice/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCo
2 Replies
d.js toolkit
d.js toolkitā€¢14mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Lachjames
LachjamesOPā€¢14mo ago
I'm running [email protected] on node v20.8.0 Btw I removed the old devDependencies causing the warning
warning package.json: "dependencies" has dependency "discord.js" with range "^14.13.0" that collides with a dependency in "devDependencies" of the same name with version "^14.11.0"
warning package.json: "dependencies" has dependency "discord.js" with range "^14.13.0" that collides with a dependency in "devDependencies" of the same name with version "^14.11.0"
But I'm still getting the same error
Want results from more Discord servers?
Add your server