-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find module "contentQueryStrings" when adding react-content-query-webpart to page #520
Comments
@Loevbo before anything, the WebPart most likely won't run in the workbench since I didn't mock the service layer to return fake data when inside the workbench, so you will most likely end up with errors because of the WebPart trying to talk to SharePoint. You can debug this WebPart directly in SPO, just make sure you bundle/package the solution without the --ship flag, add the resulting .sppkg to your app catalog and run the "gulp serve --nobrowser" command to serve the content. You will then be able to add the webpart to a site collection and changes to the code will automatically get reflected in SPO because of the serve mecanism. Try this and let me know if it helps 👍 Edit : By the way sorry for the delay I just saw this :| |
@Loevbo any update on this? |
@spplante Hello I get the same bug when I run this on both local Workbench and when I compile it into an app and use it on my live sharepoint site. |
@Loevbo Hmmm that is strange, can you try doing the same thing using the "dev" branch? I just submitted some changes in the current DEV branche, maybe it is fixed in this version for some reason. Also, are you using this webpart in SPO or SharePoint 2016? |
I'm trying to use it on SPO, |
At the root of the repository, there is a branch button where you can switch between master and dev, if you cloned the repository using Visual Studio you also have the option to switch branch within visual studio. Anyway here is the link for the dev version of this repository : https://github.com/SharePoint/sp-dev-fx-webparts/tree/dev If you are using SPO, I made available (in the dev branch for now) a zip file at the root of the project called content-query-webpart-1.4.1.zip, this is the same WebPart project but using the version 1.4.1 of SPFx which is a more recent version which allows the WebPart to run without hosting the binaries to a CDN. With this version the binaries are now included directly within the .sppkg which is much more simple, so if you are using SPO and aren't looking for SP2016 compatibility, I would recommand you to use the 1.4.1 version of the .zip file. Here's the zip file I am talking about that has the 1.4.1 project : Let me know if you have more success using this version 👍 |
I've opened the dev version of content query webpart and it returns the following erros when I run gulp serve to test it in local. src\controls\PropertyPaneQueryFilterPanel\components\QueryFilter\QueryFilter.tsx(1,89): error TS2307: Cannot find module 'moment'. |
I think I've gone blind, Can't find content-query-webpart-1.4.1.zip anywhere :( |
@Loevbo what are the exact steps you are taking from scratch? You need to perform these exact steps in order to use any SPFx WebPart :
The zip is at the root of the project in the dev branch : |
@Loevbo, did you manage to make it work iwth the 1.4.1 version? |
Hi @spplante I'm trying to add this wp on a SharePoint 2019 Not working on the environment cause the module try to use the cdn.
What are the steps to use this module on SharePoint OnPremises? Thanks for your help! |
@stact what do you mean when you say you tried 1.4.1, you tried updating the packages by yourself to 1.4.1? |
@spplante yes for on the project samples/react-content-query-webpart I've followed those instructions: |
Ok well you don't need to, I did include a version of the project converted to 1.4.1, it is in a zip file at the root of the project called content-query-webpart-1.4.1.zip. Simply unzip that file in another location and try installing/gulping that version of the project instead 👍 |
thx @spplante it's working fine :) |
Category
Expected or Desired Behavior
When I run this example. I run into a problem where i have to change
import { IWebPartContext } from '@microsoft/sp-webpart-base';
toimport { WebPartContext } from '@microsoft/sp-webpart-base';
Now there is no errors in the code and when i run
gulp serve
it loads and open the workbench.Observed Behavior
When I add the webpart to the page I get this error message
Im not sure what the problem is but now after 2 days of trying to fix this im lost, This is the first time I'm posting an issue here, so sorry if I did it wrong.
The text was updated successfully, but these errors were encountered: