Running npm run ionic:build --prod with 1.1.0 (1.0.0 runs ok).
Sourcemap is not being able to be built, which somehow interpolates with the main js minification.
I am using "ionic_bundler": "rollup", having also couple plugins in devDependencies (however not sure if they affect the build): rollup-plugin-uglify and rollup-plugin-commonjs.
Played with various settings of ionic_source_map_type with the same result.
Even settings "ionic_generate_source_map": false has the same result, which is really strange.
16:31:34] cleancss finished in 2.16 s MEM: 1461.5MB
[ DEBUG! ] worker exited, taskModule: cleancss, pid: 40628 MEM: 1461.5MB
[ DEBUG! ] worker reject, taskModule: uglifyjs, pid: 40627 MEM: 419.3MB
[16:32:10] uglifyjs failed: ENOENT: no such file or directory, open MEM: 1461.5MB
'ionic/www/build/main.js.map'
[ DEBUG! ] Error: ENOENT: no such file or directory, open 'ionic/www/build/main.js.map' at
Object.fs.openSync (fs.js:557:18) at Object.fs.readFileSync (fs.js:467:33) at Object.exports.minify
(ionic/node_modules/@ionic/app-scripts/node_modules/uglify-js/tools/node.js:120:31)
at runUglifyInternal (ionic/node_modules/@ionic/app-scripts/dist/uglifyjs.js:47:19)
at ionic/node_modules/@ionic/app-scripts/dist/uglifyjs.js:31:32 at uglifyjsWorker
(ionic/node_modules/@ionic/app-scripts/dist/uglifyjs.js:22:12) at process.<anonymous>
(ionic/node_modules/@ionic/app-scripts/dist/worker-process.js:8:9) at emitTwo
(events.js:106:13) at process.emit (events.js:191:7) at process.nextTick (internal/child_process.js:744:12)
MEM: 1461.5MB
[ DEBUG! ] build prod failed: ENOENT: no such file or directory, open
'ionic/www/build/main.js.map' MEM: 1461.5MB
[16:32:10] ionic-app-script task: "build" MEM: 1461.5MB
[16:32:10] Error: ENOENT: no such file or directory, open 'ionic/www/build/main.js.map' MEM: 1461.5MB
Error: ENOENT: no such file or directory, open 'ionic/www/build/main.js.map'
at Object.fs.openSync (fs.js:557:18)
at Object.fs.readFileSync (fs.js:467:33)
at Object.exports.minify (ionic/node_modules/@ionic/app-scripts/node_modules/uglify-js/tools/node.js:120:31)
at runUglifyInternal (ionic/node_modules/@ionic/app-scripts/dist/uglifyjs.js:47:19)
at ionic/node_modules/@ionic/app-scripts/dist/uglifyjs.js:31:32
at uglifyjsWorker (ionic/node_modules/@ionic/app-scripts/dist/uglifyjs.js:22:12)
at process.<anonymous> (ionic/node_modules/@ionic/app-scripts/dist/worker-process.js:8:9)
at emitTwo (events.js:106:13)
at process.emit (events.js:191:7)
at process.nextTick (internal/child_process.js:744:12)
Works with "ionic_use_experimental_closure": true !
Do you have a repository that we can recreate the issue from?
Thanks,
Dan
@danbucholtz will try to produce some simple use case that may help
small update: ionic_use_experimental_closure cut our bundle from 3,1 to 2 MB, but the app stopped working at all. Using ionic_use_experimental_babili makes the app and the bundle run with no problems, however the bundle grew to 3,23 MB.
I have the same problem when ionic_source_map_type is set to eval.
When removed, it compiles as expected.
Closure is prone to breaking all kinds of things. It is in there purely as an experiment right now. We have big plans for closure but it's not ready yet.
Thanks,
Dan
Hi,
Same error in 1.0.1. I think this is releated with https://github.com/driftyco/ionic-app-scripts/commit/d26b44c.
For me the problem comes from this config in my package.json :
"config": {
"ionic_bundler": "webpack",
"ionic_source_map_type": "#inline-source-map"
}
I make this because this is the only way for me to get a functionnal sourcemap in Chrome. So the new version of ionic-app-script seems looking for a file who doesn't exist because the sourcemap is configured to be inline.
@blckshrk,
We don't support #inline-source-map, we only support eval and source-map.
Thanks,
Dan
@danbucholtz I managed to reproduce my error in a really simple project:
https://github.com/kleeb/app-scripts-issue-740
npm install
npm run ionic:build --prod
not sure, but my guess is that its something connected with the custom rollup.config.js
changed
sourceMap: process.env.IONIC_GENERATE_SOURCE_MAP ? true : false,
to
sourceMap: true,
which solves my problem
@danbucholtz If i don't configure le source map as inline Chrome don't uses it. So I can't debug correctly app, because I only have the compiled js :-( Did you have a solution for that kind of issue ?
Alex
Chrome should pick up the regular, non inline source maps. I debug in chrome all the time with it set to ionic_source_map_type set to the default of source-map.
@kleeb,
It's probably best to check if process.env.IONIC_GENERATE_SOURCE_MAP === 'true' ? true : false. The reason for this is environment variables are strings, so if it was 'false simply checking for existence as a boolean would be true which could be problematic.
I think this is resolved now. I'll re-open if it's not.
Thanks,
Dan
Most helpful comment
Closure is prone to breaking all kinds of things. It is in there purely as an experiment right now. We have big plans for closure but it's not ready yet.
Thanks,
Dan