Shopify / cli

Build apps, themes, and hydrogen storefronts for Shopify
https://shopify.dev
MIT License
409 stars 124 forks source link

[Bug]: Build error #2198

Closed Noostop closed 1 year ago

Noostop commented 1 year ago

Please confirm that you have:

In which of these areas are you experiencing a problem?

App

Expected behavior

Compilation ends normally。

Actual behavior

D:\code\bundle-app>yarn build yarn run v1.22.19 $ shopify app build product-discount │ Building GraphQL types... frontend │ frontend │ > discount-frontend@1.0.0 build frontend │ > vite build frontend │ frontend │ frontend │ > discount-frontend@1.0.0 build frontend │ > vite build frontend │ frontend │ frontend │ > discount-frontend@1.0.0 build frontend │ > vite build frontend │ frontend │ node:internal/modules/cjs/loader:1078 frontend │ throw err; frontend │ ^ frontend │ frontend │ Error: Cannot find module 'D:\code\bundle-app\node_modules\node_modules\vite\bin\vite.js' frontend │ at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15) frontend │ at Module._load (node:internal/modules/cjs/loader:920:27) frontend │ at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) frontend │ at node:internal/main/run_main_module:23:47 { frontend │ code: 'MODULE_NOT_FOUND', frontend │ requireStack: [] frontend │ } frontend │ frontend │ Node.js v18.16.0

── external error ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Error coming from npm run build

Command failed with exit code 1: npm run build node:internal/modules/cjs/loader:1078 throw err; ^

Error: Cannot find module 'D:\code\bundle-app\node_modules\node_modules\vite\bin\vite.js' at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15) at Module._load (node:internal/modules/cjs/loader:920:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }

Node.js v18.16.0

discount-frontend@1.0.0 build vite build

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Verbose output

D:\code\bundle-app>yarn build
yarn run v1.22.19
$ shopify app build
 product-discount │ Building GraphQL types...
 frontend         │
 frontend         │ > discount-frontend@1.0.0 build
 frontend         │ > vite build
 frontend         │
 frontend         │
 frontend         │ > discount-frontend@1.0.0 build
 frontend         │ > vite build
 frontend         │
 frontend         │
 frontend         │ > discount-frontend@1.0.0 build
 frontend         │ > vite build
 frontend         │
 frontend         │ node:internal/modules/cjs/loader:1078
 frontend         │   throw err;
 frontend         │   ^
 frontend         │ 
 frontend         │ Error: Cannot find module 'D:\code\bundle-app\node_modules\node_modules\vite\bin\vite.js'
 frontend         │     at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
 frontend         │     at Module._load (node:internal/modules/cjs/loader:920:27)
 frontend         │     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
 frontend         │     at node:internal/main/run_main_module:23:47 {
 frontend         │   code: 'MODULE_NOT_FOUND',
 frontend         │   requireStack: []
 frontend         │ }
 frontend         │ 
 frontend         │ Node.js v18.16.0

── external error ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Error coming from `npm run build`

Command failed with exit code 1: npm run build
node:internal/modules/cjs/loader:1078
  throw err;
  ^

Error: Cannot find module 'D:\code\bundle-app\node_modules\node_modules\vite\bin\vite.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.16.0

> discount-frontend@1.0.0 build
> vite build

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Reproduction steps

  1. yarn install
  2. yarn build

Operating System

Windows 11

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

Current Shopify CLI version: 3.45.1

Shell

cmd

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

v18.16.0v18.16.0

What language and version are you using in your application?

ruby 3.2.2

Arkham commented 1 year ago

can you update your version of @shopify/cli and @shopify/app to latest and retry?

Noostop commented 1 year ago

can you update your version of @shopify/cli and @shopify/app to latest and retry? Yes, I updated to the latest version.

pacckage.json { "name": "bluetti-app", "version": "1.0.0", "main": "web/index.js", "license": "UNLICENSED", "scripts": { "shopify": "shopify", "build": "shopify app build", "dev": "shopify app dev", "info": "shopify app info", "generate": "shopify app generate", "deploy": "shopify app deploy" }, "dependencies": { "@shopify/app": "3.46.5", "@shopify/cli": "3.46.5" }, "author": "kevin", "private": true, "workspaces": [ "web", "web/frontend", "extensions/*" ] }

Error message `D:\code\bundle-app>yarn build yarn run v1.22.19 $ shopify app build my-checkout-ui-extension │ Bundling UI extension my-checkout-ui-extension... product-discount │ Building GraphQL types... my-checkout-ui-extension │ my-checkout-ui-extension successfully built frontend │ frontend │ > discount-frontend@1.0.0 build frontend │ > vite build frontend │ frontend │ frontend │ > discount-frontend@1.0.0 build frontend │ > vite build frontend │ frontend │ frontend │ > discount-frontend@1.0.0 build frontend │ > vite build frontend │ frontend │ node:internal/modules/cjs/loader:1078 frontend │ throw err; frontend │ ^ frontend │ frontend │ Error: Cannot find module 'D:\code\bundle-app\node_modules\node_modules\vite\bin\vite.js' frontend │ at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15) frontend │ at Module._load (node:internal/modules/cjs/loader:920:27) frontend │ at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) frontend │ at node:internal/main/run_main_module:23:47 { frontend │ code: 'MODULE_NOT_FOUND', Error: Cannot find module 'D:\code\bundle-app\node_modules\node_modules\vite\bin\vite.js' at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15) at Module._load (node:internal/modules/cjs/loader:920:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }

Node.js v18.16.0

discount-frontend@1.0.0 build vite build

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`

Noostop commented 1 year ago

Error: Cannot find module 'D:\code\bundle-app\node_modules\node_modules\vite\bin\vite.js'

The path of the compile and get command is wrong.

Error: Cannot find module 'D:\code\bundle-app\node_modules\node_modules\vite\bin\vite.js'

github-actions[bot] commented 1 year ago

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.

P.S. You can learn more about why we stale issues here.