question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`require` from Browserify in v0.11.0 from NPM is broken

See original GitHub issue

Hi,

After the update to v0.11.0, installing from NPM is broken. I get a bunch of the following errors (see semi-full log here).

Error: Cannot find module '../core/Common' from '/Users/laustdeleuran/Sites/revelator-website/node_modules/matter-js/build'

The error seems to come from line 46-52 in /build/matter.js. Those files are not included in the NPM build.

For now, I’m rolling back to v0.11.0.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
codeclowncommented, Nov 8, 2016

I bumped into this issue a few days ago as well, thought there was something wrong with my local setup. Ended up just loading from CDN for the time being.

Definitely only happens with Browserify, because for some reason Browserify tries to parse the require-calls in the built version that is specified as the main file for Matter.

Following the StackOverflow answer to the issue at hand, this is relevant:

The module you want to use should be built with the standalone option. That option is intended for creating a file that can be loaded by other module systems (including browserify itself, node.js, requirejs, etc.)

Should probably build the distributed file with --standalone Matter?

0reactions
codeclowncommented, Nov 9, 2016

Yes, errors are gone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error during install · Issue #1049 · browserify ... - GitHub
Just saying, currently I get this: ❯ npm i browserify npm ERR! ... "i" "browserify" npm ERR! node v0.10.33 npm ERR! npm v2.1.7...
Read more >
Cannot run npm install browserify - Stack Overflow
In order to make the workaround work, you have to. Delete the existing node_modules folder. npm install miller-rabin@1.1.1 --save-peer ...
Read more >
Browserify - npm
browser-side require() the node way. Latest version: 17.0.0, ... Start using browserify in your project by running `npm i browserify`.
Read more >
browserify | Yarn - Package Manager
Use a node-style require() to organize your browser code and load modules installed by npm. browserify will recursively analyze all the require() calls...
Read more >
Changelog - browserify
This API was added in node v0.11.8 and removed before v0.12 was released. ... https://github.com/daiweilu/browserify-broken-require ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found