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

v2 addon files not resolvable when brought into app through v1 addon #1175

Closed
simonihmig opened this issue Apr 1, 2022 · 4 comments · Fixed by #1278
Closed

v2 addon files not resolvable when brought into app through v1 addon #1175

simonihmig opened this issue Apr 1, 2022 · 4 comments · Fixed by #1278
Labels
bug Something isn't working

Comments

@simonihmig
Copy link
Collaborator

The scenario where this comes up seems to be:

graph TD
    A[app] -->|has devDependency| B(v1 addon)
    B --> |has dependency| C(v2 addon)
Loading

This was uncovered for ember-focus-trap (a v2 addon), see josemarluedke/ember-focus-trap#59.

In my particular case I have ember-boostrap (v1) depend on it. Another addon (ember-bootstrap-changeset-validation) depends on that, but its dummy app fails when running in Embroider safe mode: Module not found: Error: Can't resolve 'ember-focus-trap/modifiers/focus-trap.js'. See https://github.com/kaliber5/ember-bootstrap-changeset-validations/runs/5792294552?check_suite_focus=true. However strangely enough, it works in optimized mode! (see CI scenario).

Adding ember-focus-trap as a devDepencency to ember-bootstrap-changeset-validation fixes the issue. But that's obviously not expected.

@NullVoxPopuli
Copy link
Collaborator

Is moving the dep to dependencies an option?

@rogeraraujo90
Copy link

Yeah, I've faced the same issue here in my project and the workaround was add the dep to the project dependencies.

anehx added a commit to anehx/ember-caluma that referenced this issue Sep 26, 2022
`ember-focus-trap` needs to be a dependency because of this:
embroider-build/embroider#1175
@BryanCrotaz
Copy link

I'm seeing this even when not adding other addons that also reference ember-focus-trap
ember-bootstrap/ember-bootstrap#1831
Reproduction steps in a comment

@amiarSlimane
Copy link

amiarSlimane commented Jan 3, 2023

Still getting the same error

Build Error (PackagerRunner) in modifiers/focus-trap.js

Module not found: Error: Can't resolve '/home/user/project/node_modules/ember-focus-trap/modifiers/focus-trap.js' in '$TMPDIR/embroider/6a5753/modifiers/focus-trap.js'
ember-cli: 4.9.2
node: 18.8.0
os: linux x64

focus-trap only used in ember-bootstrap

"ember-source": "~4.9.1",
"ember-bootstrap": "^5.1.1",

"@embroider/compat": "^2.0.2",
"@embroider/core": "^2.0.2",
"@embroider/webpack": "^2.0.2",
    

i have added focus-trap as dependency to the project and i am getting the same error.

i did a temporary fix by removing it from ember-bootstrap, waiting to be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants