Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An app's production build breaks if source maps are enabled. #35

Closed
ssylvia opened this issue Oct 25, 2017 · 5 comments · Fixed by #41
Closed

An app's production build breaks if source maps are enabled. #35

ssylvia opened this issue Oct 25, 2017 · 5 comments · Fixed by #41
Assignees
Labels

Comments

@ssylvia
Copy link
Member

ssylvia commented Oct 25, 2017

When I run ember build -e=production on an app that has ember-esri-loader installed, I get the following error:

Error: ENOENT: no such file or directory, open 'project-path/esri-loader-test/tmp/uglify_writer-input_base_path-GKD3EADg.tmp/assets/dist/esri-loader.min.js.map'
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.readFileSync (fs.js:491:33)
    at UglifyWriter.processFile (project-path/esri-loader-test/node_modules/broccoli-uglify-sourcemap/index.js:101:41)
    at project-path/esri-loader-test/node_modules/broccoli-uglify-sourcemap/index.js:65:16
    at Array.forEach (native)
    at project-path/esri-loader-test/node_modules/broccoli-uglify-sourcemap/index.js:55:25
    at Array.forEach (native)
    at UglifyWriter.build (project-path/esri-loader-test/node_modules/broccoli-uglify-sourcemap/index.js:54:19)
    at project-path/esri-loader-test/node_modules/broccoli-plugin/read_compat.js:93:34
    at tryCatch (project-path/esri-loader-test/node_modules/rsvp/dist/rsvp.js:525:12)

The broccoli plugin was instantiated at:
    at Fingerprint.Plugin (project-path/esri-loader-test/node_modules/broccoli-plugin/index.js:7:31)
    at Fingerprint.Filter [as constructor] (project-path/esri-loader-test/node_modules/broccoli-filter/index.js:34:10)
    at new Fingerprint (project-path/esri-loader-test/node_modules/broccoli-asset-rev/lib/fingerprint.js:21:10)
    at Fingerprint (project-path/esri-loader-test/node_modules/broccoli-asset-rev/lib/fingerprint.js:16:12)
    at new AssetRev (project-path/esri-loader-test/node_modules/broccoli-asset-rev/lib/asset-rev.js:31:25)
    at AssetRev (project-path/esri-loader-test/node_modules/broccoli-asset-rev/lib/asset-rev.js:7:12)
    at Class.postprocessTree (project-path/esri-loader-test/node_modules/broccoli-asset-rev/index.js:31:40)
    at projectOrAddon.addons.reduce (project-path/esri-loader-test/node_modules/ember-cli/lib/utilities/addon-process-tree.js:6:25)
    at Array.reduce (native)
    at addonProcessTree (project-path/esri-loader-test/node_modules/ember-cli/lib/utilities/addon-process-tree.js:4:32)

Thought it might have something to do with this issue: emberjs/ember.js#15720, but I updated to my app to ember v2.16.0 but still get the error.

Here's a sample app: https://github.com/ssylvia/ember-esri-loader-sourcemap-build-fail-demo.

@tomwayson
Copy link
Member

tomwayson commented Nov 18, 2017

Thanks @ssylvia

Did you already try excluding esri-loader from minification in that app?

@tomwayson
Copy link
Member

I was able to repro in the dummy app by copying the source map config from your app:

    sourcemaps: {
      enabled: true,
      extensions: ['js'],
    },

I was then able to fix the build error by excluding esri-loader from minification with:

    minifyJS: {
      options: {
        exclude: ["**/esri-loader.min.js"]
      }
    }

That's at least a workaround for now.

@tomwayson
Copy link
Member

@ssylvia FYI - I have fixed this issue in esri-loader@1.5.2, but there are still some sourcemap issues in ember-esri-loader, so I won't be cutting a new release of this repo until I've had time to work those out. In the mean time you can bump esri-loader.

@tomwayson
Copy link
Member

@ssylvia this is resolved in v0.2.3

@ssylvia
Copy link
Member Author

ssylvia commented Nov 21, 2017

Thanks @tomwayson!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants