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

Using ember generate <whatever> <name> errors out #2065

Open
Jopie01 opened this issue Aug 13, 2024 · 0 comments
Open

Using ember generate <whatever> <name> errors out #2065

Jopie01 opened this issue Aug 13, 2024 · 0 comments

Comments

@Jopie01
Copy link

Jopie01 commented Aug 13, 2024

Created a brand new app with

npx ember-cli@latest new new_fancy_app -b @embroider/app-blueprint --pnpm --skip-git --skip-npm

and did some testing to make sure live-reload works. Then I wanted to create a new route with ember generate route otherroute but it failed with

unknown file: Cannot read properties of undefined (reading 'replace')

The stack trace:

TypeError: unknown file: Cannot read properties of undefined (reading 'replace')
    at cleanUrl (/home/embertesting/new_fancy_app/node_modules/.pnpm/@[email protected]/node_modules/@embroider/shared-internals/src/paths.js:54:16)
    at PluginPass.enter (/home/embertesting/new_fancy_app/node_modules/.pnpm/@[email protected]/node_modules/@embroider/shared-internals/src/template-colocation-plugin.js:28:57)
    at newFn (/home/embertesting/new_fancy_app/node_modules/.pnpm/@[email protected]/node_modules/@babel/traverse/lib/visitors.js:172:14)
    at NodePath._call (/home/embertesting/new_fancy_app/node_modules/.pnpm/@[email protected]/node_modules/@babel/traverse/lib/path/context.js:49:20)
    at NodePath.call (/home/embertesting/new_fancy_app/node_modules/.pnpm/@[email protected]/node_modules/@babel/traverse/lib/path/context.js:39:18)
    at NodePath.visit (/home/embertesting/new_fancy_app/node_modules/.pnpm/@[email protected]/node_modules/@babel/traverse/lib/path/context.js:85:31)
    at TraversalContext.visitQueue (/home/embertesting/new_fancy_app/node_modules/.pnpm/@[email protected]/node_modules/@babel/traverse/lib/context.js:89:16)
    at TraversalContext.visitSingle (/home/embertesting/new_fancy_app/node_modules/.pnpm/@[email protected]/node_modules/@babel/traverse/lib/context.js:65:19)
    at TraversalContext.visit (/home/embertesting/new_fancy_app/node_modules/.pnpm/@[email protected]/node_modules/@babel/traverse/lib/context.js:112:19)
    at traverseNode (/home/embertesting/new_fancy_app/node_modules/.pnpm/@[email protected]/node_modules/@babel/traverse/lib/traverse-node.js:22:17)
    at traverse (/home/embertesting/new_fancy_app/node_modules/.pnpm/@[email protected]/node_modules/@babel/traverse/lib/index.js:53:34)
    at transformFile (/home/embertesting/new_fancy_app/node_modules/.pnpm/@[email protected]/node_modules/@babel/core/lib/transformation/index.js:82:31)
    at transformFile.next (<anonymous>)
    at run (/home/embertesting/new_fancy_app/node_modules/.pnpm/@[email protected]/node_modules/@babel/core/lib/transformation/index.js:24:12)
    at run.next (<anonymous>)
    at transform (/home/embertesting/new_fancy_app/node_modules/.pnpm/@[email protected]/node_modules/@babel/core/lib/transform.js:22:33)
    at transform.next (<anonymous>)
    at step (/home/embertesting/new_fancy_app/node_modules/.pnpm/[email protected]/node_modules/gensync/index.js:261:32)
    at /home/embertesting/new_fancy_app/node_modules/.pnpm/[email protected]/node_modules/gensync/index.js:273:13
    at async.call.result.err.err (/home/embertesting/new_fancy_app/node_modules/.pnpm/[email protected]/node_modules/gensync/index.js:223:11)
    at /home/embertesting/new_fancy_app/node_modules/.pnpm/[email protected]/node_modules/gensync/index.js:189:28
    at /home/embertesting/new_fancy_app/node_modules/.pnpm/@[email protected]/node_modules/@babel/core/lib/gensync-utils/async.js:67:7
    at /home/embertesting/new_fancy_app/node_modules/.pnpm/[email protected]/node_modules/gensync/index.js:113:33
    at step (/home/embertesting/new_fancy_app/node_modules/.pnpm/[email protected]/node_modules/gensync/index.js:287:14)
    at /home/embertesting/new_fancy_app/node_modules/.pnpm/[email protected]/node_modules/gensync/index.js:273:13
    at async.call.result.err.err (/home/embertesting/new_fancy_app/node_modules/.pnpm/[email protected]/node_modules/gensync/index.js:223:11)

=================================================================================

For now I fixed it by adding an if statement to the cleanUrl function which checks if the variable is not undefined, else I return an empty string

export function cleanUrl(url: string): string {

But that's probably not the right solution (more like a bandage), but I lack the knowledge to dig deeper into this.

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