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

Creating a new app with v prefixes generates a different package.json#name from app-imports #123

Open
NullVoxPopuli opened this issue Dec 6, 2024 · 4 comments

Comments

@NullVoxPopuli
Copy link
Collaborator

Example: NullVoxPopuli/repro-vX-v2-vY-v1-addon-coexistence@c01ead7

In particular:

[plugin:vite:import-analysis] Failed to resolve import "repro-vX-v2-vY-v1-addon-coexistence/app" from "tests/test-helper.js". Does the file exist?

1  |  import Application from 'repro-vX-v2-vY-v1-addon-coexistence/app';
   |                           ^
2  |  import config from 'repro-vX-v2-vY-v1-addon-coexistence/config/environment';
3  |  import * as QUnit from 'qunit';

because in package.json

{
  "name": "repro-v-x-v2-v-y-v1-addon-coexistence",
  "version": "0.0.0",
@NullVoxPopuli
Copy link
Collaborator Author

NullVoxPopuli commented Dec 6, 2024

After fixing the package.json name, we see that the router name is also mismatched:

[plugin:vite:import-analysis] Failed to resolve import "repro-v-x-v2-v-y-v1-addon-coexistence/config/environment" from "app/router.js". Does the file exist?

1  |  import EmberRouter from '@ember/routing/router';
2  |  import config from 'repro-v-x-v2-v-y-v1-addon-coexistence/config/environment';
   |                      ^
3  |  export default class Router extends EmberRouter {
4  |    location = config.locationType;

@NullVoxPopuli
Copy link
Collaborator Author

as well as modulePrefix:

module.exports = function (environment) {
  const ENV = {
    modulePrefix: 'repro-v-x-v2-v-y-v1-addon-coexistence',

@NullVoxPopuli
Copy link
Collaborator Author

doesn't really matter which format / hyphenation is used as long as it all matches

@Jopie01
Copy link

Jopie01 commented Dec 12, 2024

Ember-cli at play? I had also something strange happening with underscores in the app name. See #108

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