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

[Bug]: npm run dev errors after extension creation #3094

Closed
2 tasks done
dopla-dev opened this issue Nov 11, 2023 · 2 comments
Closed
2 tasks done

[Bug]: npm run dev errors after extension creation #3094

dopla-dev opened this issue Nov 11, 2023 · 2 comments
Labels
Type: Bug Something isn't working

Comments

@dopla-dev
Copy link

Please confirm that you have:

  • Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
  • Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

App, Extension

Expected behavior

On npm run dev the app preview should load without errors

Actual behavior

After a theme app extension has been created (using npm run shopify app generate extension)
npm run dev throws the following errors:

15:46:27 │ extensions │ [Note] You cannot use gems with Shopify CLI.
15:46:27 │ extensions │ [LoadError] cannot load such file --
C:/**/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/dep
s/smart_properties/lib/smart_properties/property_collection
15:46:27 │ extensions │        They are disabled.
15:46:27 │ extensions │        Please don't modify the CLI locally.
15:46:27 │ extensions │        If you would like to contribute to the CLI       
project, please refer to
15:46:27 │ extensions │
https://github.com/Shopify/shopify-cli/blob/main/.github/CONTRIBUTING.md        
15:46:27 │ extensions │
15:46:27 │ extensions │ [Note] You cannot use gems with Shopify CLI.
15:46:27 │ extensions │ [LoadError] cannot load such file --
C:/**/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/dep
s/smart_properties/lib/smart_properties/property_collection
15:46:27 │ extensions │        They are disabled.
15:46:27 │ extensions │        Please don't modify the CLI locally.
15:46:27 │ extensions │        If you would like to contribute to the CLI       
project, please refer to
15:46:27 │ extensions │
https://github.com/Shopify/shopify-cli/blob/main/.github/CONTRIBUTING.md        
15:46:27 │ extensions │
15:46:27 │ extensions │
C:/**/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/dep
s/smart_properties/lib/smart_properties.rb:170:in `require_relative': cannot    
load such file -- C:/**/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/dep
s/smart_properties/lib/smart_properties/property_collection (LoadError)
15:46:27 │ extensions │         from
C:/**/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/dep
s/smart_properties/lib/smart_properties.rb:170:in `<top (required)>'
15:46:27 │ extensions │         from
C:/**/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:9:in `require'    
15:46:27 │ extensions │         from
C:/**/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:9:in `require'    
15:46:27 │ extensions │         from
C:/**/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli.rb:27:in `<top
 (required)>'
15:46:27 │ extensions │         from
C:/**/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:9:in `require'    
15:46:27 │ extensions │         from
C:/**/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:9:in `require'    
15:46:27 │ extensions │         from
C:/**/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/load_shopify.rb:18:in     
`<top (required)>'
15:46:27 │ extensions │         from
C:/**/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:45:in
`require_relative'
15:46:27 │ extensions │         from
C:/**/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:45:in `<main>'    

Error
    at execCLI2 (file:///C:/**/node_modules/@shopify/cli-kit/dist/public/node/ruby.js:64:15)
    at async runThemeAppExtensionsServer (file:///C:/**/node_modules/@shopify/app/dist/cli/services/dev/processes/theme-app-extension.js:6:5)
    at async Object.action (file:///C:/**/node_modules/@shopify/app/dist/cli/services/dev/ui/components/Dev.js:43:32)
    at async file:///C:/**/node_modules/@shopify/cli-kit/dist/private/node/ui/components/ConcurrentOutput.js:87:21
    at async Promise.all (index 1)
    at async runProcesses (file:///C:/**/node_modules/@shopify/cli-kit/dist/private/node/ui/components/ConcurrentOutput.js:84:17)

Verbose output

See actual behaviour (verbose log exceeded character count - can provide if there's an email I can send it to?)

Reproduction steps

  1. npm run dev on clean app template -- works fine
  2. npm run shopify app generate extension
  3. npm run dev -- throws error

Operating System

Windows 11

Shopify CLI version (check your project's package.json if you're not sure)

3.50.2

Shell

cmd

Node version (run node -v if you're not sure)

v21.1.0

What language and version are you using in your application?

Node 21.1.0

@dopla-dev dopla-dev added the Type: Bug Something isn't working label Nov 11, 2023
@dopla-dev
Copy link
Author

Additional info - I'm using the 'start with remix' app template in JavaScript. The type of extension is a theme app extension.

I tried the alternate command 'npm run generate extension' on a fresh template - same error occurred.

@dopla-dev
Copy link
Author

Update - looks like this was a conflict with a global Shopify cli install. Resolved by creating a new user account on my pc and working with the cli as an app dependency only, as recommended by the docs.

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

No branches or pull requests

1 participant