Closed ghost closed 6 years ago
I get this error with rollup@0.66.2
and rollup-plugin-uglify@6.0.0
.
I get the same error message when using rollup-plugin-terser@3.0.0
instead of rollup-plugin-uglify.
Could you provide a reproduction example with which code are you trying to minify? Also post the whole stack trace of the error.
Not in a position to provide a minimal repro just yet, but here's my stack trace:
[!] TypeError: Cannot read property 'end' of undefined
TypeError: Cannot read property 'end' of undefined
at Object.generateBundle (/Users/rigibson/src/ms-rest-js/node_modules/rollup-plugin-uglify/index.js:38:19)
at /usr/local/lib/node_modules/rollup/dist/rollup.js:21774:54
at Array.map (<anonymous>)
at /usr/local/lib/node_modules/rollup/dist/rollup.js:21773:62
me too.
+1
I suspect it's due to environment's rollup
version not up to requirement, since event hooks such as renderStart
isn't present until rollup version 0.66. To illustrate, I'm currently using gulp-better-rollup
, which comes with its own version of rollup, and it's not 0.66 up.
This is the answer. Look at you terminal with yarn/npm installs. They should warn you about incorrect peer dependencies.
I was using rullup@0.66.6
and rollup-plugin-terser@3.0.0
and it did not work so I downgraded to older versions.
@Andersos Could you please provide repo with reproducing of this issue?
Yes, the repo I had this problem with is this one https://github.com/getas/styleguide
Edit:
In the root of the repo you can update to rullup@0.66.6
and rollup-plugin-terser@3.0.0
and then you can go into /components/movie-card
and then run yarn
. It will run the root rollup.config.js
.
@Andersos You are probably trying to build with global rollup version. Package in those directory doesn't know about local rollup. Try to change the commend with this
"build": "../../node_modules/.bin/rollup src/index.js --config ../../rollup.config.js -o dist/index.js"
You were right. I had rollup@0.64.1
installed globaly. Hope others that come over this thread also checks that.
You can list out global dependencies with either npm list -g --depth=0
or yarn global list
.
I uninstalled rollup
with npm uninstall -g rollup
.
It’s very likely this was my problem too :)
I guess this is an argument for npx
over npm i -g
.
When I run this I get "TypeError: Cannot read property 'end' of undefined"