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.

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

1 Answer 1

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?

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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