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

"hifi sourcemaps" don't work on a new Ember project #10460

Open
jagthedrummer opened this issue May 8, 2024 · 2 comments
Open

"hifi sourcemaps" don't work on a new Ember project #10460

jagthedrummer opened this issue May 8, 2024 · 2 comments

Comments

@jagthedrummer
Copy link

On a brand new 5.8.1 project I tried to follow these instructions for enabling hifi sourcemaps: https://nullvoxpopuli.com/2023-12-19-hifi-sourcemap/

This didn't seem to make any change in the sourcemap situation.

In the Ember Discord NullVoxPopuli let me know that "non-embroider sourcemaps are kinda borked" and that "the solution is embroider" (https://discord.com/channels/480462759797063690/1237817026899349575/1237826401386631278).

I'm guessing the team is already aware that hifi sourcemaps are impossible to achieve with the defaults that come with a new app, but I can't find any mention of that anywhere on the public web, so I'm mainly opening this issue as a way for other people to be able to find this info.


Output from ember version --verbose && npm --version && yarn --version:

ember-cli: 5.8.1
node: 18.19.1
acorn: 8.10.0
ada: 2.7.2
ares: 1.20.1
base64: 0.5.0
brotli: 1.0.9
cjs_module_lexer: 1.2.2
cldr: 43.1
icu: 73.2
llhttp: 6.1.0
modules: 108
napi: 9
nghttp2: 1.57.0
nghttp3: 0.7.0
ngtcp2: 0.8.1
openssl: 3.0.13+quic
simdutf: 3.2.18
tz: 2023c
undici: 5.28.3
unicode: 15.0
uv: 1.44.2
uvwasi: 0.0.19
v8: 10.2.154.26-node.28
zlib: 1.2.13.1-motley
os: darwin arm64
10.2.4
1.22.22
@jagthedrummer
Copy link
Author

I got hifi sourcemaps to work in my new app by doing this:

yarn add --dev @embroider/core @embroider/compat @embroider/webpack webpack

Then updated ember-cli-build.js to look like this:

'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const { Webpack } = require('@embroider/webpack');

module.exports = function (defaults) {
  const app = new EmberApp(defaults, {
  });

  return require('@embroider/compat').compatBuild(app, Webpack, {
    packagerOptions: {
      webpackConfig: {
        devtool: 'source-map',
      },
    },
  });
};

@jagthedrummer
Copy link
Author

After updating my real app to try to use embroider it seems that some add-ons may not play nicely with embroider. Is there any possible way to get hifi sourcemaps to work in a non-embroider app?

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

No branches or pull requests

1 participant