Coder Social home page Coder Social logo

Comments (12)

Gamer025 avatar Gamer025 commented on August 14, 2024 6

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 (sindresorhus/ow#215) also said they have this problem with 0.27.0
image
I also tried creating a completely new Node project and installed only [email protected] 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')
image

from builders.

favna avatar favna commented on August 14, 2024 2

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.

from builders.

DuckingElias avatar DuckingElias commented on August 14, 2024 1

Temporary solution:

  1. Type npm shrinkwrap. This deletes your package-lock.json and creates an npm-shrinkwrap.json
  2. Inside the npm-shrinkwrap.json, search for node_modules/@discordjs/builders
  3. Under dependencies of node_modules/@discordjs/builders, change the version of ow to ^0.27.0
  4. Delete your node_modules and type npm install

from builders.

almostSouji avatar almostSouji commented on August 14, 2024 1

Why was this issue closed when the issue itself hasn't been resolved?

The author of the first PR attempting to fix this issue (#55) used a closing keyword which is triggered on merge into the main branch.

from builders.

ze avatar ze commented on August 14, 2024 1

#58 Fixed the bug for me! Now the discordjs package needs to be updated to use 0.9.0 instead of 0.8.2!

from builders.

favna avatar favna commented on August 14, 2024

Or temporary solution for yarn users add to your package.json

"resolutions": {
  "ow": "0.27.0"
}

from builders.

KhafraDev avatar KhafraDev commented on August 14, 2024

no it didn't, but it took some time for a real fix @Gamer025 sorry about that

from builders.

NateFlynn-Silktide avatar NateFlynn-Silktide commented on August 14, 2024

Is there any solution for this at the moment? I'm getting the same error on a fresh build with @discord/[email protected] and [email protected].

Got plenty of other bits to be working on in the meantime if the fix for this is still a way off 🙂

from builders.

KhafraDev avatar KhafraDev commented on August 14, 2024

there is a pr to fix this linked above, in the meantime you can force install an older builders version with npm i @discordjs/[email protected]

from builders.

VIKTORVAV99 avatar VIKTORVAV99 commented on August 14, 2024

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.

from builders.

VIKTORVAV99 avatar VIKTORVAV99 commented on August 14, 2024

Ah that makes sense, thanks for reopening it.

from builders.

ramennbowls avatar ramennbowls commented on August 14, 2024

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')

from builders.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.