Code Monkey home page Code Monkey logo

Comments (10)

web-padawan avatar web-padawan commented on September 25, 2024

Uncaught (in promise) TypeError: Illegal invocation
at t.value (custom-style.js:81)

See Polymer/polymer#5256

Uncaught DOMException: custom element constructors must call super() first and must not return a different object

I suspect this is related to Polymer/tools#398
There is a proper Babel setup in https://github.com/web-padawan/polymer3-webpack-starter
Most important thing is to use @babel/plugin-transform-classes not later than v7.0.0-beta.35
Not sure about the version used by react-scripts.

from base-starter-react.

Peppe avatar Peppe commented on September 25, 2024

react scripts next branch uses plugin-transform-classes v7.0.0-beta.44. I'll test with older versions.

from base-starter-react.

Peppe avatar Peppe commented on September 25, 2024

I locked plugin-transform-classes to beta.35 with npm install --save @babel/[email protected]. I didn't notice a difference in how it worked compared to 44.

from base-starter-react.

web-padawan avatar web-padawan commented on September 25, 2024

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.

from base-starter-react.

web-padawan avatar web-padawan commented on September 25, 2024

Submitted #13 to track the UglifyJS issue which is not something easy to fix from our side.

from base-starter-react.

amahdy avatar amahdy commented on September 25, 2024

It works with the react-scripts that comes in packages.json. I don't know how much of a difference there is, but for me, I had to run yarn install before yarn build, since I don't have react-scripts linked globally, and it works fine. Here is the output:

yarn run v1.3.2
$ react-scripts build
Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  38.05 KB  build/static/js/main.82e62e51.js
  121 B     build/static/css/main.0c62578a.css

The project was built assuming it is hosted at the server root.
You can control this with the homepage field in your package.json.
For example, add this to build it for GitHub Pages:

  "homepage" : "http://myname.github.io/myapp",

The build folder is ready to be deployed.
You may serve it with a static server:

  serve -s build

Find out more about deployment here:

  http://bit.ly/2vY88Kr

✨  Done in 7.12s.

from base-starter-react.

web-padawan avatar web-padawan commented on September 25, 2024

Looks like you are not using p3-preview branch. Here is my output:

$ yarn build
yarn run v1.9.4
$ react-scripts build
Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file:

 	./node_modules/@polymer/polymer/lib/utils/mixin.js:13

Read more here: http://bit.ly/2tRViJ9

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
FAIL: 1

from base-starter-react.

amahdy avatar amahdy commented on September 25, 2024

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 react-scripts. But yarn install works for development experiments.

from base-starter-react.

web-padawan avatar web-padawan commented on September 25, 2024

The roadmap for react-scripts 2.0.0 is available here: facebook/create-react-app#5024

from base-starter-react.

web-padawan avatar web-padawan commented on September 25, 2024

Fixed by #16 on the p3-preview branch, will merge to master once other starters are fixed.

from base-starter-react.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.