watson-developer-cloud / discovery-components

IBM Watson Discovery components
https://watson-developer-cloud.github.io/discovery-components/storybook
Apache License 2.0
21 stars 38 forks source link

runExampleApp.sh Build Error #525

Open william-ly-ibm opened 1 year ago

william-ly-ibm commented 1 year ago

Description

I am trying to use ./runExampleApp.sh to run the example application, however I am running into an error when the script begins building components.

Error Output:

Building components... ➤ YN0000: [@ibm-watson/discovery-react-components]: Process started ➤ YN0000: [@ibm-watson/discovery-styles]: Process started ➤ YN0000: [@ibm-watson/discovery-react-components]: [!] Error: Cannot find module '../cache-contexts' ➤ YN0000: [@ibm-watson/discovery-react-components]: Require stack: ➤ YN0000: [@ibm-watson/discovery-react-components]: - C:\...\discovery-components\node_modules\@babel\core\lib\config\helpers\config-api.js ➤ YN0000: [@ibm-watson/discovery-react-components]: - C:\...\discovery-components\node_modules\@babel\core\lib\config\files\configuration.js ➤ YN0000: [@ibm-watson/discovery-react-components]: - C:\...\discovery-components\node_modules\@babel\core\lib\config\files\index.js ➤ YN0000: [@ibm-watson/discovery-react-components]: - C:\...\discovery-components\node_modules\@babel\core\lib\index.js ➤ YN0000: [@ibm-watson/discovery-react-components]: - C:\...\discovery-components\node_modules\@svgr\plugin-jsx\lib\index.js ➤ YN0000: [@ibm-watson/discovery-react-components]: - C:\...\discovery-components\node_modules\@svgr\core\lib\plugins.js ➤ YN0000: [@ibm-watson/discovery-react-components]: - C:\...\discovery-components\node_modules\@svgr\core\lib\convert.js ➤ YN0000: [@ibm-watson/discovery-react-components]: - C:\...\discovery-components\node_modules\@svgr\core\lib\index.js ➤ YN0000: [@ibm-watson/discovery-react-components]: - C:\...\discovery-components\node_modules\@svgr\rollup\lib\index.js ➤ YN0000: [@ibm-watson/discovery-react-components]: - C:\...\discovery-components\packages\discovery-react-components\rollup.config.js ➤ YN0000: [@ibm-watson/discovery-react-components]: - C:\...\discovery-components\node_modules\rollup\dist\shared\loadConfigFile.js ➤ YN0000: [@ibm-watson/discovery-react-components]: - C:\...\discovery-components\node_modules\rollup\dist\bin\rollup

To resolve this, I attempted to create the ./cache-contexts file because after checking a working version that I had of the example application, it appeared to just be an empty file.

The error above was resolved, however I'm now facing another issue:

Error output:

Building components... ➤ YN0000: [@ibm-watson/discovery-react-components]: Process started ➤ YN0000: [@ibm-watson/discovery-styles]: Process started ➤ YN0000: [@ibm-watson/discovery-styles]: Process exited (exit code 0), completed in 4s 7ms ➤ YN0000: [@ibm-watson/discovery-react-components]: ➤ YN0000: [@ibm-watson/discovery-react-components]: src/index.tsx → dist/index.es.js, dist/index.es.min.js... ➤ YN0000: [@ibm-watson/discovery-react-components]: [!] (plugin rpt2) Error: Could not resolve '../../modules/es6.object.to-string' from ../../modules/es6.object.to-string?commonjs-external ➤ YN0000: [@ibm-watson/discovery-react-components]: ➤ YN0000: [@ibm-watson/discovery-react-components]: at error (C:\...\discovery-components\node_modules\rollup\dist\shared\rollup.js:198:30) ➤ YN0000: [@ibm-watson/discovery-react-components]: at ModuleLoader.handleResolveId (C:\...\discovery-components\node_modules\rollup\dist\shared\rollup.js:22661:24) ➤ YN0000: [@ibm-watson/discovery-react-components]: at C:\...\discovery-components\node_modules\rollup\dist\shared\rollup.js:22624:26 ➤ YN0000: [@ibm-watson/discovery-react-components]: ➤ YN0000: [@ibm-watson/discovery-react-components]: Process exited (exit code 1), completed in 1m 12s

I am unsure now what to do.

What package(s) (including version) are you using?

node: v16.20.1 yarn: 3.2.3

Steps to reproduce the issue

Running ./runExampleApp.sh after installing the pre-requisites listed.

jhpedemonte commented 1 year ago

A couple of us ran the script and had no issues. My guess, from the logs you posted, is that there is something wrong with your yarn cache. I would suggest running yarn install --check-cache to see if that helps. If not, try deleting node_modules in the top-level of the repo, as well as your ~/.yarn/cache.

jhpedemonte commented 1 year ago

Oh, just noticed that you seem to be on a Windows system. We didn't test on such a system (I'm not sure any of us have access to one). Not sure what could be going wrong.