0

I am following below MS article to practise jquery integration with SPFX.

https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/add-jqueryui-accordion-to-web-part

Getting below error message while i am try to view the results in local workbench with gulp serve

Error - [tsc] src/webparts/jQueryWebPart/JQueryWebPartWebPart.ts(6,33 ): error TS2306: File '.../jquery-webpart/src/webparts/jQueryWebPart/MyAccord ionTemplate.ts' is not a module. Error - 'tsc' sub task errored after 9.31 s exited with code 2

Do i am missing any things? Tried a lot of approach.But no luck.

  • What is the version of SPFx and the target platform? How do you import the template in your 'main' file? – Jarek Danielak May 13 at 6:47
  • You need to export your template module. see this question. – Ganesh Sanap May 13 at 10:20
0

I can't say for sure without looking at your solution, but I have noticed that the instructions say to create your MyAccordionTemplate.ts in the src/webparts/jQuery folder. The error you get seems to say that you're looking at a file located in src/webparts/jQueryWebPart/JQueryWebPartWebPart.ts. Did you rename the web part? If not, take a look that you're using the right paths?

I hope this will help you find the issue?

  • I renamed to "JQueryWebPartWebPart" instead of jquery. – Vig May 13 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.