-
Notifications
You must be signed in to change notification settings - Fork 4
p3-preview is unbuildable. Vaadin components on npm are unusable in React apps. #12
Comments
I suspect this is related to Polymer/tools#398 |
react scripts next branch uses plugin-transform-classes v7.0.0-beta.44. I'll test with older versions. |
I locked plugin-transform-classes to beta.35 with |
Blocked by facebook/create-react-app#932 The stable Babel 7.0.0 no longer has the problem from the above comments, so waiting for CRA to update to it, and then we will have to bump versions here and verify. |
Submitted #13 to track the UglifyJS issue which is not something easy to fix from our side. |
It works with the
|
Looks like you are not using
|
Tried it one more time and got the same error, tried it one third time and worked. If it's ok with you, I will send you the working project to check it. But clearly it's an issue, especially that it does not work with latest versions of |
The roadmap for |
Fixed by #16 on the |
How to verify
yarn build
Reasons behind the failure
This is because parts of polymer (and maybe Vaadin) is not precompiled to ES5 before they are released under npm and react-scripts 1.0 does not want to compile modules to minify them, due to the risk of breaking something.
This is a problem with all react projects, not just our starter. Even if you create a react project from scratch and just add say to it, then it will fail in this manner.
Updating to react-scripts 2.0
They have made a change in policy in react-scripts 2.0 and now they build them to minify. With 2.0,
yarn build
passes. However at runtime when testing the built version, the web components won't work and you have a huge amount of exceptions in the console.Steps to test with react-scripts 2.0
I will create a new app from scratch with react-scripts 2.0 and add vaadin-date-picker from npm to it. Nothing else.
npx create-react-app@next --scripts-version=2.0.0-next.66cc7a90 react-scripts-2-test
cd react-scripts-2-test
yarn add @vaadin/vaadin-date-picker
import '@vaadin/vaadin-date-picker'
and<vaadin-date-picker></vaadin-date-picker>
yarn start
. The component works! (the theme is very off and the component is barely visible, but that is another issue)yarn build
. Passes without issues.serve -s build
App loads up, everything except the date picker is there. There is a barrage of errors in the console, where of 30 first ones are this:Additionally there is these two.
Summary
I have no way to deploy my app anywhere. I can't put it up anywhere without the build so I can only show my app on my personal computers. You can't do anything other that development with React and Vaadin Components on npm, so the combo provides zero business or other kind of value.
The text was updated successfully, but these errors were encountered: