Code Monkey home page Code Monkey logo

Comments (6)

jonschlinkert avatar jonschlinkert commented on May 25, 2024 1

Do you know the author of set-getter? It seems to be based of your set-value library.

Yes, I'm a collaborator on that package.

Webpack uses define as a global function therefore it thinks its calling amd-module which is why this error is thrown

Right, this is a bug in webpack, because it's not calling an amd-module. Browserify doesn't have this issue because it uses node's require system, and node's require system doesn't have this issue, but webpack does have this issue.

I'm curious why you would still want to create an issue on set-getter knowing that this has nothing to do with that library. I suggest you add a comment to that issue on webpack describing the bug to help the maintainers get it fixed. After a quick search of the webpack issues, I found a few other issues related to this as well.

from pretty-remarkable.

nbwar avatar nbwar commented on May 25, 2024 1

I just glanced quickly at the package and assumed the define function was an internal function didn't read the docs you are correct. I'll continue to look into better workarounds.

from pretty-remarkable.

jonschlinkert avatar jonschlinkert commented on May 25, 2024

I traced this down to be a problem with your dependency module list-item.

I've seen this once before. This is a webpack bug. Webpack has a problem with variables named define, which is a 100% valid variable name.

from pretty-remarkable.

nbwar avatar nbwar commented on May 25, 2024

Webpack uses define as a global function therefore it thinks its calling amd-module which is why this error is thrown. Do you know the author of set-getter? It seems to be based of your set-value library.

webpack/webpack#2958

from pretty-remarkable.

nbwar avatar nbwar commented on May 25, 2024

I added an issue there because it is indeed an issue if someone is trying to use that package with webpack. Although it is an issue with webpack, they have had the issue for months and its seems to be a 'nice to have' and 'opinionated' change where a quick fix to get this library working on webpack builds is to change the function name.

from pretty-remarkable.

jonschlinkert avatar jonschlinkert commented on May 25, 2024

I added an issue there because it is indeed an issue if someone is trying to use that package with webpack.

but you're asking other library maintainers to actually change their code to accommodate a bug in webpack. Please understand that from my perspective it's not a "quickfix" because I can think of at least 78 other packages that would need to be updated as well. Or should we just update those "as you need them"? Hopefully you can see the faulty logic here. This really needs to be fixed in webpack, because even if we were to change the variable names in set-getter, it's just coincidental that it's that library surfacing atm. Tomorrow it might be something else. To fix the problem, we need to "strike at the root" and do it in webpack.

I do understand how you feel though, webpack has a ridiculous number of issues and this might never get resolved. Maybe it's possible to create a transform or plugin to do this.

from pretty-remarkable.

Related Issues (5)

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.