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

type=module packages are not translated correctly if they are v2 addons #1674

Open
Tracked by #1773
NullVoxPopuli opened this issue Nov 19, 2023 · 3 comments
Open
Tracked by #1773

Comments

@NullVoxPopuli
Copy link
Collaborator

This is an issue for tracking exploration in #1572
And this is separate from this type=module issue: #1672

It is not possible to reproduce this behavior in the a monorepo setup for some reason, even with injected dependencies.

Repro:

  • create v2 addon
  • add type=module to package.json
  • publish it (or use @universal-ember/preem @ 0.1.0)
  • create separate app in separate repo/folder
  • add the above package
  • start the app
  • visit /
  • receive error:
    Module not found: Error: Can't resolve '.' in '/home/nullvoxpopuli/Development/NullVoxPopuli/package-majors/node_modules/.embroider/rewritten-packages/@glimmer/component.23618b61'
    Did you mean 'index.js'?
    BREAKING CHANGE: The request '.' failed to resolve only because it was resolved as fully specified
    (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
    The extension in the request is mandatory for it to be fully specified.
    Add the extension to the request.
    
    note that the error is calling out @glimmer/component.

best lead we have is this #1572 (comment)

@ef4
Copy link
Contributor

ef4 commented Dec 13, 2023

I suspect that the code that breaks here is already changed on embroider main, so we should probably recheck.

@NullVoxPopuli
Copy link
Collaborator Author

Testing this again with the changes on main -- my steps:

npx ember-cli@beta new my-app --embroider --pnpm
# [email protected]
cd my-app
pnpm add @universal-ember/[email protected]

add app/components/demo.gjs
with content,

import { ThemeToggle } from '@universal-ember/preem';

export default ThemeToggle;

and app/templates/application.hbs

<Demo />

and then

pnpm start
# error, I need to install template-imports
# ctrl+c
pnpm add ember-template-imports
pnpm start
# visit http://localhost:4200
# no error in console!

@NullVoxPopuli
Copy link
Collaborator Author

Re-opening to communicate that in embroider@3, this isn't fixed

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

2 participants