vuestorefront-community / prestashop

Convert your traditional PrestaShop website into a fast, mobile friendly and modern website.
MIT License
51 stars 31 forks source link

[Bug]: [dev:theme] FATAL Cannot find module '@vue-storefront/prestashop-api/server' #5

Closed mrbig00 closed 2 years ago

mrbig00 commented 2 years ago

Expected Behavior

Running yarn dev without issues

Actual Behavior

yarn run v1.22.5
$ concurrently "yarn:dev:*"
$ cd packages/api-client && yarn dev
$ cd packages/theme && yarn dev
$ cd packages/composables && yarn dev
$ nuxt
$ rollup -c -w
$ rollup -c -w
[dev:api-client] (node:14518) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /home/mrbig/WebProjects/prestastorefront/node_modules/rollup-plugin-typescript2/node_modules/tslib/package.json.
[dev:api-client] Update this package.json to use a subpath pattern like "./*".
[dev:api-client] (Use `node --trace-deprecation ...` to show where the warning was created)
[dev:api-client] rollup v2.57.0
[dev:api-client] bundles src/index.ts → lib/index.cjs.js, lib/index.es.js...
[dev:composables] (node:14532) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /home/mrbig/WebProjects/prestastorefront/node_modules/rollup-plugin-typescript2/node_modules/tslib/package.json.
[dev:composables] Update this package.json to use a subpath pattern like "./*".
[dev:composables] (Use `node --trace-deprecation ...` to show where the warning was created)
[dev:composables] rollup v2.57.0
[dev:composables] bundles src/index.ts → lib/index.cjs.js, lib/index.es.js...
[dev:theme] ℹ VSF Starting Vue Storefront Nuxt Module
[dev:theme] ✔ VSF Installed Vue Storefront Context plugin
[dev:theme] ✔ VSF Installed Vue Storefront SSR plugin
[dev:theme] ✔ VSF Installed VSF Logger plugin
[dev:theme] ✔ VSF Installed Vue Storefront E2E testing plugin
[dev:theme] ✔ VSF Installed Internationalization Cookies plugin
[dev:theme] ✔ VSF Installed nuxt Composition API Module
[dev:theme] ✔ VSF Installed StorefrontUI Module
[dev:theme] ✔ VSF Installed Performance Module
[dev:theme] ℹ VSF Using raw source/ESM for @vue-storefront/prestashop
[dev:theme] ℹ VSF Using raw source/ESM for @vue-storefront/core
[dev:theme] ℹ VSF Using raw source/ESM for @storefront-ui/vue
[dev:theme] ℹ VSF Using raw source/ESM for @storefront-ui/shared
[dev:theme] ℹ VSF Starting Theme Module
[dev:theme] ℹ VSF Watching changes in @vue-storefront/nuxt-theme-module and used platform theme directory
[dev:theme] ℹ VSF Adding theme files...
[dev:theme] ✔ VSF Added 60 theme file(s) to _theme folder
[dev:theme] ℹ Middleware starting....
[dev:theme] ℹ Loading integrations...
[dev:theme] ℹ - Loading: prestashop @vue-storefront/prestashop-api/server
[dev:theme]
[dev:theme]  FATAL  Cannot find module '@vue-storefront/prestashop-api/server'
[dev:theme] Require stack:
[dev:theme] - /home/mrbig/WebProjects/prestastorefront/node_modules/@vue-storefront/middleware/lib/index.cjs.js
[dev:theme] - /home/mrbig/WebProjects/prestastorefront/node_modules/@vue-storefront/middleware/nuxt/index.js
[dev:theme] - /home/mrbig/WebProjects/prestastorefront/node_modules/@nuxt/core/dist/core.js
[dev:theme]
[dev:theme]   Require stack:
[dev:theme]   - /home/mrbig/WebProjects/prestastorefront/node_modules/@vue-storefront/middleware/lib/index.cjs.js
[dev:theme]   - /home/mrbig/WebProjects/prestastorefront/node_modules/@vue-storefront/middleware/nuxt/index.js
[dev:theme]   - /home/mrbig/WebProjects/prestastorefront/node_modules/@nuxt/core/dist/core.js
[dev:theme]   at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
[dev:theme]   at Function.Module._load (node:internal/modules/cjs/loader:778:27)
[dev:theme]   at Module.require (node:internal/modules/cjs/loader:1005:19)
[dev:theme]   at n (/home/mrbig/WebProjects/prestastorefront/node_modules/jiti/dist/v8cache.js:2:2472)
[dev:theme]   at /home/mrbig/WebProjects/prestastorefront/node_modules/@vue-storefront/middleware/lib/index.cjs.js:103:25
[dev:theme]   at Array.reduce (<anonymous>)
[dev:theme]   at registerIntegrations (/home/mrbig/WebProjects/prestastorefront/node_modules/@vue-storefront/middleware/lib/index.cjs.js:98:41)
[dev:theme]   at createServer (/home/mrbig/WebProjects/prestastorefront/node_modules/@vue-storefront/middleware/lib/index.cjs.js:172:24)
[dev:theme]   at ModuleContainer.VueStorefrontMiddleware (/home/mrbig/WebProjects/prestastorefront/node_modules/@vue-storefront/middleware/nuxt/index.js:5:19)
[dev:theme]   at ModuleContainer.addModule (/home/mrbig/WebProjects/prestastorefront/node_modules/@nuxt/core/dist/core.js:239:34)
[dev:theme]
[dev:theme]
[dev:theme] ╭──────────────────────────────────────────────────────────────────────────────╮│                                                                              ││   ✖ Nuxt Fatal Error                                                         ││
                                                   ││   Error: Cannot find module '@vue-storefront/prestashop-api/server'          ││   Require stack:                                                             ││   -
           ││   /home/mrbig/WebProjects/prestastorefront/node_modules/@vue-storefront/mi   ││   ddleware/lib/index.cjs.js                                                  ││   -                                                                          ││   /home/mrbig/WebProjects/prestastorefront/node_modules/@vue-storefront/mi   ││   ddleware/nuxt/index.js                                                     ││   - /home/mrbig/WebProjects/prestastorefront/node_modules/@nuxt/core/dist/   ││   core.js
           ││                                                                              │╰──────────────────────────────────────────────────────────────────────────────╯
[dev:theme]
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[dev:theme] yarn run dev:theme exited with code 1
[dev:api-client] (!) Generated empty chunks
[dev:api-client] index, index
[dev:api-client] created lib/index.cjs.js, lib/index.es.js in 3.3s
[dev:api-client] bundles src/index.server.ts → server/index.js...
[dev:api-client] created server/index.js in 2s
[dev:composables] created lib/index.cjs.js, lib/index.es.js in 5.5s

Possible Solution

No response

Steps to reproduce

No response

What version of PrestaShop integration are you using?

1.7.7

What version of Node.js are you using?

v16.10.0

What browser (and version) are you using?

Chrome, latest

What operating system (and version) are you using?

Windows 10, but node in wsl2

Relevant log output

No response

Code of Conduct

samberrry commented 2 years ago

@mrbig00 Hi, have you successfully built the project with yarn build command?

SebastianMineur commented 2 years ago

@mrbig00 Hi, have you successfully built the project with yarn build command?

I had the same problem and this did the trick for me

samberrry commented 2 years ago

@NervousNerve great. Thanks

nn4u commented 1 year ago

Hello, running the same issue on Vercel. Build works like a charm on local. I tried so many things and nothing worked. Any idea on this bug resolution?