Error
node:internal/modules/cjs/loader:1148
throw err;
^
Error: Cannot find module './lib/arrayStrictEquals.mjs'
43 Replies
there is no file called './lib/arrayStrictEquals.mjs'
This may have something to do with the recent Shapeshift or Utilities update as I started getting this error as well after updating some versions in my package.json
we might need the full error stack upon this one tho
as you're on it, mind sending the full stack and file contents of node_modules/@sapphire/shapeshift?
PS: this could be because djs haven't updated to latest shapeshift
that was my stack
i think its not shapeshift
its utilities
Yeah
@Baylem can you cat this file for me?
C:\Users\Dev\WebstormProjects\discord-rewrite\node_modules@sapphire\utilities\dist\cjs\index.cjs
In webstorm its just at the very top on dist/cjs/index.cjs
when I click the reference
does node_modules@sapphire\utilities\dist\cjs\lib\arrayStrictEquals.mjs exist?
just this
iirc @Favna you broke shit, even the ci was failing in the lastest push
there is a temporary workaround, change all the .mjs in imports to .cjs
looking at the files in 3.15.2 all the imports are .cjs
but its not in 3.16
Find and Replace All
my savior
:prayge:
nah its all broken
i fix one file
another pops up
fix that one another pops up
this one is
@eX you have to open
node_modules@sapphire\utilities\dist\cjs\index.cjs
then replace all .mjs
with .cjs
until they fix itdist\cjs\lib\cutText
i'm trying to see where this bug landed
dist\cjs\lib\deepClone.mjs
yeah it just keeps going
@Baylem i believe there was a flag that would interop cjs and mjs in nodejs right?
try using that?
dist\cjs\index.cjs
dist\cjs\lib\cutText
dist\cjs\lib\deepClone
dist\cjs\lib\filterNullAndUndefined
dist\cjs\lib\filterNullAndUndefinedAndEmpty
... list goes on
yeah I'm gonna use that instead of doing this, idk how many there will be
what was the flag?
I think its --experimental-modules
i havent tried yet
try and tell me if your bot runs now
Yeah no that flag doesn't work
becuase you have to change
type: module
and that breaks everything else
@Baylem i think its --experimental-require-module
oh
right
no s
lmk if that works
nah
--experimental-modules does run
but runs into the same mjs import error
--experimental-require-module doesn't exist
weird
node 22?
I'm running v20 , so that might be a 22 thing
I was running LTS
I'll update node
that flag was released like 2 months ago
ah ok
makes sense
this project is on an older node version
Dumb question but for a production level project, should I go ahead and update to 22? I was only staying on 20 for LTS
if you want to update to 22 only to use the flag, better not
favna broke something in his esbuild plugin
Yeah I'll just wait on Favna
p sure favna will see this, but should I go ahead and open a github issue? @UndiedGFX
might not be necessary
Dafuq happened :dragonwhat:
For now set your resolutions to utilities 3.15.x I guess
npm
npm doesn't have anything to update transient dependencies so you'll have to provide
overrides
.
In your package.json
:
Then run npm install
. You can verify the change by checking your package-lock.json
Yarn v1
Yarn v1 (deprecated, recommend updating to v4 (see /tag query:yarnv4
) does not have a way to update transient dependencies so a similar strategy is required as npm:
In your package.json
:
Then run yarn install
. You can verify the change by checking your yarn.lock
Yarn v4
Yarn v4 can update transient dependencies so run the command:
pnpm
pnpm can also update transient dependencies so run the command:
Ignore the whole update thing there
@eX
@Baylem
issue solved in 3.16.1
Thanks
@UndiedGFX@Baylem 3.16.1 sapphire ?
@sapphire/utilities
Damn it!
Its work