browserify / wzrd.in

browserify as a service.
http://wzrd.in
MIT License
637 stars 96 forks source link

Not possible to bundle modules with scoped module names like @cycle/core #115

Closed voronianski closed 8 years ago

voronianski commented 8 years ago

Unfortunately it's not possible to bundle modules with names like @cycle/core.

I tried to encode / symbol - https://wzrd.in/standalone/@cycle%2Fcore@latest - and this results in such error:

---FLAGRANT SYSTEM ERROR---

(logs uuid: 17010860-c992-11e5-90df-f9b2a1bb84a8 )

Error: "Command failed: 
module.js:340
    throw err;
          ^
Error: Cannot find module '@cycle%2Fcore'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.require.resolve (module.js:384:19)
    at [eval]:1:9
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:456:26)
    at evalScript (node.js:532:25)
    at startup (node.js:80:7)
    at node.js:902:3
"

killed: false
code: 8
signal: null
stdout: 
stderr: 
module.js:340
    throw err;
          ^
Error: Cannot find module '@cycle%2Fcore'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.require.resolve (module.js:384:19)
    at [eval]:1:9
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:456:26)
    at evalScript (node.js:532:25)
    at startup (node.js:80:7)
    at node.js:902:3

dirPath: /tmp/@cycle%2Fcore11612-11613-13pfcdl

This is probably an issue with the package, and not browserify-cdn itself.
If you feel differently, feel free to file a bug report at:

    https://github.com/jfhbrook/browserify-cdn/issues

Include the ENTIRETY of the contents of this message, and the maintainer(s)
can try to help you out.

Have a nice day!

https://wzrd.in/debug-bundle/@cycle%2Fcore@latest debug:

---FLAGRANT SYSTEM ERROR---

(logs uuid: 77f16640-c994-11e5-90df-f9b2a1bb84a8 )

Error: "browserify exited with code 1"

code: 1
stderr: Error: Cannot find module '@cycle%2Fcore' from '/tmp/@cycle%2Fcore11612-11613-1b98j5z/node_modules/@cycle%2Fcore'
    at /usr/lib/node_modules/browserify/node_modules/resolve/lib/async.js:50:17
    at process (/usr/lib/node_modules/browserify/node_modules/resolve/lib/async.js:119:43)
    at /usr/lib/node_modules/browserify/node_modules/resolve/lib/async.js:128:21
    at load (/usr/lib/node_modules/browserify/node_modules/resolve/lib/async.js:60:43)
    at /usr/lib/node_modules/browserify/node_modules/resolve/lib/async.js:66:22
    at /usr/lib/node_modules/browserify/node_modules/resolve/lib/async.js:21:47
    at Object.oncomplete (fs.js:107:15)

dirPath: /tmp/@cycle%2Fcore11612-11613-1b98j5z

This is probably an issue with the package, and not browserify-cdn itself.
If you feel differently, feel free to file a bug report at:

    https://github.com/jfhbrook/browserify-cdn/issues

Include the ENTIRETY of the contents of this message, and the maintainer(s)
can try to help you out.

Have a nice day!
voronianski commented 8 years ago

It's fixed in version 6.0.2 however @latest tag still return 6.0.0 - https://www.npmjs.com/package/@cycle/core

jfhbrook commented 8 years ago

It's entirely possible to get modules with scoped names. (example). Something else is going on.

As far as resolving latest goes, that's a cache invalidation issue.

voronianski commented 8 years ago

@jfhbrook ok, then I'm closing this one.

jfhbrook commented 8 years ago

For caching issues, probably https://github.com/jfhbrook/wzrd.in/issues/75 is the most appropriate issue to follow.

voronianski commented 8 years ago

@jfhbrook I have a quick question, is it possible when making multi POST to return one bundle without duplicating dependencies?

For now sometimes libraries cannot work with including them twice (e.g. React) - https://github.com/voronianski/esnextbin/issues/5

jfhbrook commented 8 years ago

The short answer is "no."

The long answer is that this is dependent on npm's behavior. npm2 doesn't flatten dependencies, but npm3 does (or at least tries). We're using npm2 because we don't feel npm3 is ready for prime time. Regardless, there's no real way to make guarantees about how npm decides to install dependencies.

voronianski commented 8 years ago

@jfhbrook but what if create another version of multi endpoint with somekind of payload similar to package.json. It will create one folder on server -> run npm install and package all dependencies in one bundle, m?

gaearon commented 8 years ago

We're using npm2 because we don't feel npm3 is ready for prime time.

Would transitioning to npm3 or even allowing both involve a lot of effort? npm3 has been out for quite some time, and it’s pretty stable apart from the speed issues.

vkammerer commented 8 years ago

I cast my vote for upgrading to npm3. This issue is quite annoying..