Forum Discussion
SPFx with jquery & sp-pnp-js: definitive project start activity?
- Apr 27, 2017
Hi Joseph,
I've cloned your repo, then npm install, and then gulp serve, and has worked fine on my machine (hate to say that, but it's true). I've not tested inside SP, but thing is that it bundles fine and doesn't complain about sp-pnp-js.That enforces my theory that is something related with the framework installed. Did you try to re-install the entire spfx?
npm uninstall -g Pernille-Eskebo/generator-sharepoint
npm install -g Pernille-Eskebo/generator-sharepoint@latest
Dean,
Thanks for the reference. I have actually already signed up at Voitano for the bundle and have watched some of the content already. Also worked through the 6 or 7 lessons on the MS getting started web site. Getting SPFx to work hasn't actually been the issue here. I want to make it clear to everyone who cares to read this thread:
The problem is integrating sp-pnp-js
I've done several "sample" type "build your first SPFx web part" projects and have had no problem with anything not working as it is supposed to.
The issue I get is that even after following the advice in the PnP JS github repo, I still get a "red squiggly" under "sp-pnp-js" in the code editor and errors in the gulp response as illustrated in one of the earlier posts in this thread. Apparently TS is not finding the PnP, and I just don't see why not because I have done everything I was told to do. It works for jQuery. It does not work for sp-pnp-js (unless, as I stated above, I first uninstall and then reinstall everything -- which I have to do every day I boot up to work on this thing).
I just want to get this fixed so I can move on to the real work of solving my customer's business issues instead of figuring out why my editor/compiler can't find something. If anyone can help me help my compiler find the "sp-pnp-js" library I would be extremely grateful. Thanks again.
I'll take a look and see if I can't get you sorted. Can you share the project somewhere? Ideally, remove the node_modules folder... pushing to a github public repo & sending the URL will be perfect.
- Joseph AckermanApr 25, 2017Iron Contributor
Thanks for your kind offer, Andrew. (Looking forward to the new Voitanos content, btw)
You can find it here:
https://github.com/acksoft/QuickLinks
- Luis MañezApr 27, 2017MVP
Hi Joseph,
I've cloned your repo, then npm install, and then gulp serve, and has worked fine on my machine (hate to say that, but it's true). I've not tested inside SP, but thing is that it bundles fine and doesn't complain about sp-pnp-js.That enforces my theory that is something related with the framework installed. Did you try to re-install the entire spfx?
npm uninstall -g Pernille-Eskebo/generator-sharepoint
npm install -g Pernille-Eskebo/generator-sharepoint@latest
- Joseph AckermanApr 30, 2017Iron Contributor
Well, looks like we are back to square one. I am getting the red squiggly and the "sp-pnp-js" not found again. Friday afternoon, everything was just fine as I mentioned in my last post but rebooting my machine today I got this:
PS C:\projects\quicklinks> gulp serve
Build target: DEBUG
[18:04:09] Using gulpfile C:\projects\quicklinks\gulpfile.js
[18:04:09] Task 'C:\Users\joseph_ackerman\AppData\Roaming\npm\gulp.cmd' is not in your gulpfile
[18:04:09] Please check the documentation for proper gulpfile formatting
[18:04:09] Task 'C:\Users\joseph_ackerman\AppData\Roaming\npm\gulp.cmd' is not in your gulpfile
[18:04:09] Please check the documentation for proper gulpfile formatting
About to exit with code: 1
Process terminated before summary could be written, possible error in async code not continuing!
Trying to exit with exit code 1Then two minutes later, I tried again and instead of that response, I got the old one that is embedded as an image above in this thread with these:
[18:21:53] Error - typescript - src\webparts\quicklinks\QuicklinksWebPart.ts(21,16): error TS2307: Cannot find module 'sp-pnp-js'.
I am left thinking only that my boot up sequence is somehow breaking the tool chain. Being new to all of this new CLI stuff (the old ones I understood and wrote many C and Clipper programs back in the 80's), I haven't the faintest idea what to do next. Very frustrating. I can't even express how much I hate this. When I build SP Add-ins with Visual Studio and NuGet, it just *works*. Starting every work day with a new "WTF?" moment is no fun.
This new process is too fragile: too many vendors, too many interlocking tools expecting to much of each other's output, not enough *specific* error information when things fail. I committed to the Microsoft stack back in the early 90's because they had the best tools and superior documentation (at the time, Visual Basic was *awesome*). Now it's "Use these 5 other things and if it doesn't work, tough". Sorry for the rant, but this is crazy-making. Thanks for listening.