microsoft-search / pnp-modern-search

Home of PnP Modern Search solutions, helping you move from classic to modern SharePoint and beyond
https://microsoft-search.github.io/pnp-modern-search
Other
389 stars 341 forks source link

v4.0 cannot find 'webpack' and other modules when setting up search-parts project #725

Closed aliotsy closed 3 years ago

aliotsy commented 3 years ago

Version used Ex: 4.0

Describe the bug While following the instructions for setting up the solution locally, 'webpack' module is not found when I run gulp bundle in the search-parts projects.

To Reproduce Follow instructions at https://microsoft-search.github.io/pnp-modern-search/how-to-contribute/#setting-up-the-solution-locally

  1. Open the search-extensibility project and run npm i, gulp bundle, and npm link.
  2. Open the search-parts project and run npm link @pnp/modern-search-extensibility and gulp bundle.
  3. See error

Expected behavior gulp bundle runs, allowing me to run npm run serve.

Desktop (please complete the following information):

Additional context I'm able to address the error by running npm link webpack and then attempting gulp bundle again, but then encounter the same error with the following modules:

Again, running npm link for each module seems to address the error, but then gulp bundle errors on sass because it can't find node_modules/office-ui-fabric-react/dist/sass/_References.scss. One more npm link for office-ui-fabric-react fixes that, but then gulp bundle gives me this:

Screen Shot 2021-01-30 at 4 13 03 PM

Gave up at that point.

FranckyC commented 3 years ago

Hi @aliotsy , did you run npm i in the search-parts project?

aliotsy commented 3 years ago

Hi @aliotsy , did you run npm i in the search-parts project?

I did run npm i before npm link, and that didn't work, but just now I ran npm i after npm link but before gulp bundle, and that DID work! Thanks!

Might be nice to clarify that in step 2 of the documentation.

prabhu8323 commented 3 years ago

Hi @aliotsy , I have also faced the same issue as you. I have followed the steps as you did but still getting the error as in below screen shot:

image

aliotsy commented 3 years ago

Hi @aliotsy , I have also faced the same issue as you. I have followed the steps as you did but still getting the error as in below screen shot:

Hi @prabhu8323, I encountered that, too. Resolution for me was to be sure I cleaned up everything from running npm i (e.g. remove node_modules folder and package-lock.json), both in search-parts and search-extensibility projects, and run all instructions from step 1.

prabhu8323 commented 3 years ago

Hi @aliotsy , Thanks for your prompt response. I downloaded the solution again and deleted package-lock.json and node_modules from both the solution. And I have executed the same steps as mentioned in documentation. I executed npm link command from search-part solution and then npm i. Still, I am getting the error as below:

image

Laul0 commented 3 years ago

Hi @prabhu8323,

The npm link @pnp/modern-search-extensibility must be performed after the npm i.

As suggested by @aliotsy, the documentation can be updated to afford some clarity with the PR #1077.

Does this information fix your issue?

wobba commented 3 years ago

Linking should not be needed as the code is updated to use the npm reference @pnp/modern-search-extensibility. Better if docs reflect that, remove the link step all together.

Laul0 commented 3 years ago

Understood. I will push another PR