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

External packages not working #79

Closed
weyert opened this issue Dec 10, 2018 · 1 comment
Closed

External packages not working #79

weyert opened this issue Dec 10, 2018 · 1 comment

Comments

@weyert
Copy link
Contributor

weyert commented Dec 10, 2018

  • kcd-scripts version: 0.48.0
  • node version: v11.3.0
  • npm (or yarn) version:
import DatePicker from 'react-datepicker'

(see index.js)

What you did:
I am trying to make my own component library for frequently used components, and reducers etc. As long I am doing npm run build it's all working fine but when I am trying to run npm run build --bundle it's failing for theumd-build with the following error:

[umd] [!] (babel plugin) TypeError: @babel/template placeholder "NODE": Property expression of ExpressionStatement expected node to be of a type ["Expression"] but instead got "VariableDeclarator"
[umd] node_modules/react-datepicker/es/index.js
[umd] TypeError: @babel/template placeholder "NODE": Property expression of ExpressionStatement expected node to be of a type ["Expression"] but instead got "VariableDeclarator"

What happened:

After executing the command ./node_modules/.bin/kcd-scripts build --bundle --no-clean --size-snapshot as found in the paypal/downshift-repo. I am getting the above mentioned error. I am not sure how I could resolve this.

Reproduction repository:
I have made a small reproducible case of my issue:
https://github.com/weyert/kcd-scripts-issue

Problem description:
I am doing something wrong when using third-party packages but not sure what. I think the problem that this package react-datepicker is already precompiled.

Suggested solution:

@kentcdodds
Copy link
Owner

You need to override the commonjs rollup plugin I'm guessing.

As a reminder, I'm not supporting this package. I use it myself and I fix my own issues, but I don't help support other people's use cases. I don't have time. Feel free to fork it.

Good luck!

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