Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Things that need peerDeps (like react) fail to build for multibundles #130

Open
prakhar1989 opened this issue Jul 6, 2016 · 7 comments
Open

Comments

@prakhar1989
Copy link

prakhar1989 commented Jul 6, 2016

Hi!

Thanks for this fantastic service! I was trying out a package - react-tag-input in ESNext and I got this weird issue in the console. The message directed me to post this here, so that's why I'm here.

--- error #0: ---
(logs uuid: 52e09ea0-4317-11e6-8c65-79f7842fe37c )

Error: "browserify exited with code 1"

code: 1
stderr: Error: Cannot find module 'react-tag-input' from '/tmp/react-tag-input11666-1238-1kr0jwk/node_modules/react-tag-input'
    at /home/admin/browserify-cdn/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:46:17
    at process (/home/admin/browserify-cdn/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:173:43)
    at ondir (/home/admin/browserify-cdn/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:188:17)
    at load (/home/admin/browserify-cdn/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43)
    at onex (/home/admin/browserify-cdn/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31)
    at /home/admin/browserify-cdn/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
    at Object.oncomplete (fs.js:107:15)

dirPath: /tmp/react-tag-input11666-1238-1kr0jwk
------

You can see what I have on ESNextBin here and see the package source here. As a package author, I'd love to give an example of the package usage on ESNextBin, so if you have any ideas on what I can do to make this work, I'll highly appreciate it. Thanks! 👍

@jfhbrook
Copy link
Collaborator

jfhbrook commented Jul 6, 2016

Interesting. I would have to play with this more, but a few ideas:

  1. Is this related to known problems with peer dependency resolution? I feel like this limitation is really painful for react demos.
  2. What API call is esnextbin making? Is there a good way to find that out?

@jfhbrook
Copy link
Collaborator

jfhbrook commented Jul 6, 2016

Doesn't matter, I have repro here:

https://wzrd.in/standalone/react-tag-input@latest

  1. Could this be related to the fact that I've been putting off upgrading wzrd.in to node 4? D:

@jfhbrook
Copy link
Collaborator

jfhbrook commented Jul 6, 2016

package.json looks well-formed but I see a lot of

https://github.com/prakhar1989/react-tags/blob/master/dist-modules/reactTags.js#L5

in the main export. Those can cause problems with browserify.

@jfhbrook
Copy link
Collaborator

jfhbrook commented Jul 6, 2016

One thing you can try doing too, is to make a tmpdir, go into it, make a package.json, npm install react-tag-manager and then run node -pe "require('react-tag-manager')" and see what happens?

@prakhar1989
Copy link
Author

prakhar1989 commented Jul 6, 2016

Thanks a ton for looking into this so quickly! The above suggestion is the first thing I tried and it seems to work fine -

λ node -pe "require('react-tag-input').WithContext"
{ [Function: DragDropContextContainer]
  DecoratedComponent:
   { [Function]
     displayName: 'ReactTags',
     propTypes:
      { tags: [Object],
        placeholder: [Object],
        labelField: [Object],
        suggestions: [Object],
        delimiters: [Object],
        autofocus: [Object],
        inline: [Object],
        handleDelete: [Function: bound checkType],
        handleAddition: [Function: bound checkType],
        handleDrag: [Object],
        allowDeleteFromEmptyInput: [Object],
        handleInputChange: [Object],
        minQueryLength: [Object],
        shouldRenderSuggestions: [Object],
        removeComponent: [Object],
        autocomplete: [Object],
        readOnly: [Object],
        classNames: [Object] },
     getDefaultProps: { [Function: getDefaultProps] isReactClassApproved: {} },
     defaultProps:
      { placeholder: 'Add new tag',
        tags: [],
        suggestions: [],
        delimiters: [Object],
        autofocus: true,
        inline: true,
        allowDeleteFromEmptyInput: true,
        minQueryLength: 2,
        autocomplete: false,
        readOnly: false } },
  displayName: 'DragDropContext(ReactTags)',
  childContextTypes: { dragDropManager: [Function: bound checkType] } }

Let me know if there's anything else I can provide to help you debug! Thanks =)

@jfhbrook
Copy link
Collaborator

jfhbrook commented Jul 6, 2016

It might be a while until I can get back to this, just a heads-up.

@prakhar1989
Copy link
Author

Sure no problem. Really appreciate any time you can put into this! Thank
you :)
On Jul 5, 2016 10:35 PM, "Joshua Holbrook" notifications@github.com wrote:

It might be a while until I can get back to this, just a heads-up.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#130 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAnoISJ0k-iAXzSNP0gakmDdaQ4sV6CEks5qSxR5gaJpZM4JFrNW
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants