Closed KhafraDev closed 2 years ago
Temporary solution:
npm shrinkwrap
. This deletes your package-lock.json and creates an npm-shrinkwrap.jsonnode_modules/@discordjs/builders
dependencies
of node_modules/@discordjs/builders
, change the version of ow to ^0.27.0
npm install
Or temporary solution for yarn users add to your package.json
"resolutions": {
"ow": "0.27.0"
}
Did the linked PR actually fix this issue?
I also had this problem yesterday and updated to 0.8.2 today, but im still getting the same error when trying to import @discordjs/builders.
Already reset my modules folder to make sure its using ow 0.27.0 and builder 0.8.2
Someone in the linked ow issue (https://github.com/sindresorhus/ow/issues/215) also said they have this problem with 0.27.0
I also tried creating a completely new Node project and installed only ow@0.27.0 and tried to run a mjs file only containing:
import ow from 'ow';
ow.string.minLength(1);
Still resulted in TypeError: Cannot read properties of undefined (reading 'minLength')
no it didn't, but it took some time for a real fix @Gamer025 sorry about that
Is there any solution for this at the moment? I'm getting the same error on a fresh build with @discord/builders@0.8.2
and ow@0.27.0
.
Got plenty of other bits to be working on in the meantime if the fix for this is still a way off 🙂
there is a pr to fix this linked above, in the meantime you can force install an older builders version with npm i @discordjs/builders@0.7.0
Why was this issue closed when the issue itself hasn't been resolved?
I was about to create a new issue for it before I looked at pull requests where #56 linked here.
Why was this issue closed when the issue itself hasn't been resolved?
The author of the first PR attempting to fix this issue (https://github.com/discordjs/builders/pull/55) used a closing keyword which is triggered on merge into the main branch.
Ah that makes sense, thanks for reopening it.
If this helps at all, even after having 'ow' downgraded to ^0.27.0
, the error still occurs for me but only when importing it using ES6.
import { SlashCommandBuilder } from '@discordjs/builders'
When using 'require', the error doesn't appear.
const { SlashCommandBuilder } = require('@discordjs/builders')
If this helps at all, even after having 'ow' downgraded to
^0.27.0
, the error still occurs for me but only when importing it using ES6.import { SlashCommandBuilder } from '@discordjs/builders'
When using 'require', the error doesn't appear.
const { SlashCommandBuilder } = require('@discordjs/builders')
There is no require
in ESM. Anyway there are PRs #56 and #58 and whichever will end up being merged will mean ow
is gone and this problem is resolved.
Issue description
This issue is caused by ow, as the code below shows.
This issue did not occur on v0.7.x. edit: https://github.com/sindresorhus/ow/issues/215
Code sample
@discordjs/builders version
0.8.1
Node.js version
16.13.0
Operating system
Windows
Priority this issue should have
High (immediate attention needed)