magento / pwa-studio

🛠Development tools to build, optimize and deploy Progressive Web Applications for Magento 2.
https://developer.adobe.com/commerce/pwa-studio/
Open Software License 3.0
1.07k stars 683 forks source link

[BUG] WebPack Dependency #801

Closed eboxrocks closed 5 years ago

eboxrocks commented 5 years ago

When I try to install Venia via yarn, even against the test demo server, I am running into the following issue that appears to be a problem with the package.json.

Node v11.9.0 Yarn v1.13.0 MacOS Sierra 10.12.6

I have changed the dev dependency to ~2.0.0-rc.19 so that they match which removed the warning below, but still have the same error.

Here is the output of my build locally:

yarn run v1.13.0 warning package.json: "dependencies" has dependency "@magento/pwa-buildpack" with range "~2.0.0-rc.19" that collides with a dependency in "devDependencies" of the same name with version "^2.0.0-rc.19" $ yarn run clean && yarn run build:esm && yarn run validate-queries && yarn run build:prod warning package.json: "dependencies" has dependency "@magento/pwa-buildpack" with range "~2.0.0-rc.19" that collides with a dependency in "devDependencies" of the same name with version "^2.0.0-rc.19" $ rimraf dist esm warning package.json: "dependencies" has dependency "@magento/pwa-buildpack" with range "~2.0.0-rc.19" that collides with a dependency in "devDependencies" of the same name with version "^2.0.0-rc.19" $ BABEL_ENV=development WARN_RESOLVE=1 babel src --out-dir esm --root-mode 'upward' --source-maps --copy-files You may see some warnings that @magento/venia-drivers could not be resolved. This is normal and not an error; Venia exports a virtual import path and babel-plugin-module-resolver is hardcoded to warn about it. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/RootComponents/Category/category.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/RootComponents/Product/Product.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/RootComponents/Search/container.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/RootComponents/Search/search.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/App/container.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/CategoryList/categoryList.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/CategoryList/categoryTile.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/Checkout/Receipt/receiptContainer.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/Checkout/wrapper.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/CmsBlock/cmsBlock.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/CreateAccount/container.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/CreateAccountPage/createAccountPageContainer.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/Gallery/item.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/Header/cartTrigger.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/Header/container.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/Header/header.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/Header/navTrigger.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/MiniCart/miniCart.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/MiniCart/product.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/MiniCart/trigger.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/MyAccountMenuPage/MenuItem/index.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/MyAccountMenuPage/MyAccountMenuPage/myAccountMenuPageContainer.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/MyAccountMenuPage/MyAccountMenuTrigger/myAccountMenuTriggerContainer.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/Navigation/categoryLeaf.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/Navigation/categoryTree.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/Navigation/container.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/NotFound/notFound.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/ProductImageCarousel/carousel.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/ProductImageCarousel/thumbnail.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/PurchaseDetailsPage/PurchaseDetails/purchaseDetailsContainer.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/PurchaseHistoryPage/PurchaseHistory/purchaseHistoryContainer.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/PurchaseHistoryPage/PurchaseHistoryItem/purchaseHistoryItem.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/SearchBar/autocomplete.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/SearchBar/container.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/SearchBar/suggestedCategories.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/SearchBar/suggestedProduct.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/components/SignIn/container.js. Could not resolve "@magento/venia-drivers" in file /Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/src/index.js. Successfully compiled 273 files with Babel. warning package.json: "dependencies" has dependency "@magento/pwa-buildpack" with range "~2.0.0-rc.19" that collides with a dependency in "devDependencies" of the same name with version "^2.0.0-rc.19" $ node ./validate-queries.js Using environment variables from .env Validating queries based on schema at https://release-dev-rxvv2iq-zddsyhrdimyra.us-4.magentosite.cloud/graphql... (node:78822) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification. Retrieved introspection query. Configuring validator... All queries valid against attached GraphQL API. warning package.json: "dependencies" has dependency "@magento/pwa-buildpack" with range "~2.0.0-rc.19" that collides with a dependency in "devDependencies" of the same name with version "^2.0.0-rc.19" $ webpack -p --color --progress --profile --env.mode production Using environment variables from .env /Applications/MAMP/htdocs/pwa-studio/node_modules/webpack-cli/bin/cli.js:235 throw err; ^

Error: Cannot find module '@magento/pwa-buildpack' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:609:15) at Function.Module._load (internal/modules/cjs/loader.js:535:25) at Module.require (internal/modules/cjs/loader.js:663:17) at require (/Applications/MAMP/htdocs/pwa-studio/node_modules/v8-compile-cache/v8-compile-cache.js:159:20) at Object. (/Applications/MAMP/htdocs/pwa-studio/packages/venia-concept/webpack.config.js:12:5) at Module._compile (/Applications/MAMP/htdocs/pwa-studio/node_modules/v8-compile-cache/v8-compile-cache.js:178:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10) at Module.load (internal/modules/cjs/loader.js:626:32) at tryModuleLoad (internal/modules/cjs/loader.js:566:12) at Function.Module._load (internal/modules/cjs/loader.js:558:3) at Module.require (internal/modules/cjs/loader.js:663:17) at require (/Applications/MAMP/htdocs/pwa-studio/node_modules/v8-compile-cache/v8-compile-cache.js:159:20) at WEBPACK_OPTIONS (/Applications/MAMP/htdocs/pwa-studio/node_modules/webpack-cli/bin/convert-argv.js:115:13) at requireConfig (/Applications/MAMP/htdocs/pwa-studio/node_modules/webpack-cli/bin/convert-argv.js:117:6) at /Applications/MAMP/htdocs/pwa-studio/node_modules/webpack-cli/bin/convert-argv.js:124:17 at Array.forEach () at module.exports (/Applications/MAMP/htdocs/pwa-studio/node_modules/webpack-cli/bin/convert-argv.js:122:15) at yargs.parse (/Applications/MAMP/htdocs/pwa-studio/node_modules/webpack-cli/bin/cli.js:232:39) at Object.parse (/Applications/MAMP/htdocs/pwa-studio/node_modules/webpack-cli/node_modules/yargs/yargs.js:567:18) at /Applications/MAMP/htdocs/pwa-studio/node_modules/webpack-cli/bin/cli.js:210:8 at Object. (/Applications/MAMP/htdocs/pwa-studio/node_modules/webpack-cli/bin/cli.js:500:3) at Module._compile (internal/modules/cjs/loader.js:734:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10) at Module.load (internal/modules/cjs/loader.js:626:32) at tryModuleLoad (internal/modules/cjs/loader.js:566:12) at Function.Module._load (internal/modules/cjs/loader.js:558:3) at Module.require (internal/modules/cjs/loader.js:663:17) at require (internal/modules/cjs/helpers.js:20:18) at Object. (/Applications/MAMP/htdocs/pwa-studio/node_modules/webpack/bin/webpack.js:155:2) at Module._compile (internal/modules/cjs/loader.js:734:30) 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.

eboxrocks commented 5 years ago

Actually closing, I cloned again, re-ran the build and it worked the next time. Not sure what happened prior.