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

Error when importing eventbrite object #72

Open
millerf opened this issue Jun 4, 2020 · 4 comments
Open

Error when importing eventbrite object #72

millerf opened this issue Jun 4, 2020 · 4 comments

Comments

@millerf
Copy link

millerf commented Jun 4, 2020

Hi there,

I just installed a package on a CSR version of reactJS. Basically the server is running on node.js, and I get this error when importing the module:

import eventbrite from 'eventbrite';

Results on this error, both on front and back-end side:

Error: Cannot find module 'encoding'
    at webpackMissingModule (webpack-internal:///./node_modules/isomorphic-fetch/node_modules/node-fetch/lib/body.js:5:80)
    at eval (webpack-internal:///./node_modules/isomorphic-fetch/node_modules/node-fetch/lib/body.js:5:163)
    at Object../node_modules/isomorphic-fetch/node_modules/node-fetch/lib/body.js (/front/build/server.js:3410:1)
    at __webpack_require__ (/front/build/server.js:27:30)
    at eval (webpack-internal:///./node_modules/isomorphic-fetch/node_modules/node-fetch/index.js:5:338)
    at Object../node_modules/isomorphic-fetch/node_modules/node-fetch/index.js (/front/build/server.js:3399:1)
    at __webpack_require__ (/front/build/server.js:27:30)
    at eval (webpack-internal:///./node_modules/isomorphic-fetch/fetch-npm-node.js:1:15)
    at Object../node_modules/isomorphic-fetch/fetch-npm-node.js (/front/build/server.js:3388:1)
    at __webpack_require__ (/front/build/server.js:27:30)

The strange thing is that I only IMPORT evenbrite, I am not even using it.

  • Node version: running on docker container node:10-alpine
  • Browser name and version: Any
  • Operating system: Docker
@kwelch
Copy link
Contributor

kwelch commented Jun 12, 2020

Can you send over a repro repo?

I have a working codesandbox that uses either require or import, but I realize webpack resolution can be much different than codesandbox.

Thanks

@emichips
Copy link

emichips commented Aug 3, 2021

Same error to me for the same Docker env, Node 14

@emichips
Copy link

emichips commented Aug 3, 2021

Same error to me for the same Docker env, Node 14

I solved following this
https://dev.to/mukul_singhal/write-es6-in-node-using-babel-3m7p

Basically it can work thanks to Babel transpiler

@kwelch
Copy link
Contributor

kwelch commented Nov 12, 2021

Thanks I appreciate the follow up.

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

3 participants