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

Module not found: Error: bug: embroider resolver's meta is not propagating #1752

Open
gossi opened this issue Jan 10, 2024 · 1 comment
Open

Comments

@gossi
Copy link
Contributor

gossi commented Jan 10, 2024

I'm running into this error:

Module not found: Error: bug: embroider resolver's meta is not propagating

The main idea was to use webpack.resolve.alias to point to code that I moved somewhere else.

Repro:

After checkout:

pnpm install
cd web/
pnpm test:prebuild
pnpm start

POI in the code:

  • The main folder is web/app/domain/ where I moved my code into
  • The webpack config found in web/ember-cli-build.js for the alias
  • The ts config: web/tsconfig.ts with its paths which made it possible at first at least in the editor

I traced it here:

if (movedPkg !== pkg) {
let originalFromFile = request.meta?.originalFromFile;
if (typeof originalFromFile !== 'string') {
throw new Error(`bug: embroider resolver's meta is not propagating`);
}
request = request.rehome(originalFromFile);
pkg = movedPkg;
}

And with a bit more debug, I figured it was coming from this file: web/app/domain/supporting/tina/index.ts, which when renamed into index.gts it worked.

Which is weird, because on node_modules/.embroider/rewritten-app I can see, the gts files are already correctly transpiled to .ts (using template() from @ember/template-compiler).

@gossi
Copy link
Contributor Author

gossi commented Jan 10, 2024

Oh, renaming ts files that re-export gts files to gts, aka index.ts -> index.gts. Then I run into very unreliable errors:

Renaming this from ts to gts... is only a patch, and not even a helpful one. It seems like it is only forwarding the issue to another problem, which is described in detail in #1800 (with a reproduction).

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