-
-
Notifications
You must be signed in to change notification settings - Fork 34
Description
Hello!
We recently upgraded @auth0/auth0-spa-js to a more recent version and our production build started failing with this error:
cleaning up...
Build Error (UglifyWriter)
EISDIR: illegal operation on a directory, read
Notably v1.6.2 does not have this error, but anything from 1.7.0 does.
Reproducing it locally I found this log from the error dump:
ERROR Summary:
- broccoliBuilderErrorStack: Error: EISDIR: illegal operation on a directory, read
at Object.readSync (fs.js:523:3)
at tryReadSync (fs.js:348:20)
at Object.readFileSync (fs.js:385:19)
at getSourceMapContent (/Users/meirish/code/cloud-ui/node_modules/broccoli-uglify-sourcemap/lib/get-sourcemap-content.js:18:30)
at processFile (/Users/meirish/code/cloud-ui/node_modules/broccoli-uglify-sourcemap/lib/process-file.js:41:19)
at Function.processFileParallel (/Users/meirish/code/cloud-ui/node_modules/broccoli-uglify-sourcemap/lib/worker.js:9:10)
at MessagePort.<anonymous> (/Users/meirish/code/cloud-ui/node_modules/broccoli-uglify-sourcemap/node_modules/workerpool/dist/workerpool.min.js:25:16559)
at MessagePort.emit (events.js:311:20)
at MessagePort.onmessage (internal/worker/io.js:78:8)
What ends up happening here is srcURL.from() here: https://github.com/ember-cli/broccoli-uglify-sourcemap/blob/master/lib/get-sourcemap-content.js#L10 returns an empty string '' as the first item in the urls array when it gets to our app's vendor.js file, which then errors here: https://github.com/ember-cli/broccoli-uglify-sourcemap/blob/master/lib/get-sourcemap-content.js#L18 when it tries to read a directory instead of a file.
Removing the empty string from the array results in a successful build, but with this warning:
[UglifyWriter][WARN] (broccoli-uglify-sourcemap) "chunk.40bafbb6f4ed25560db2.js.map;", "chunk.cc45f8eb6b4af1864c92.js.map//#" referenced in "assets/vendor.js" could not be found
Which seems to point to ember-auto-import.
I'm uncertain where the issue is - is it in the auth0 source map urls, the source-map-url package that returns '', or maybe ember-auto-import. Has anyone ever seen this or have any guidance for where to look further?