generator-spfx
generator-spfx copied to clipboard
Module parse failed: Unexpected token (1:0)
General Information
- [*] Usage
- [*] Development
- [ ] Documentation
- [ ] Feature Request
Specific generator
- [ ] Addons
- [ ] HandlebarsJS
What Version you are running?
- NodeJS: 10.16.3
- NPM: 6.11.2
- @pnp/spfx: 1.9.0
Describe your problem
Clean install target is spo and gulp serve produces error: Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type.
|I tried to see if this had been reported but may have missed it. Just tried this today. Really trying to get Vue going!!
@dpevilgenius - Can you please share what options you have chosen for scaffolding the project? Screenshot of all options selected will do. Thanks 🙏
I mostly chose defaults and targeted spo
There is one strange thing in your screenshot. It seems to me like you never have been asked for the Framework to choose? And not even the other questions.
Can you please check if a .yo-rc file already in the folder exists? The create a subfolder and .yo-rc file mostly have some negative side effects. If there is a .yo-rc file already can you please share the content?
These are the questions from my test run on a blank and completely empty folder:
The best way is no matter if you use the Microsoft or this generator to start from a blank folder and leave do not create a subfolder. Thank you for help to understand what causes this issue.
Yes, I didn't get most of those choices!! There was a .yo-rc file in the Repos folder but no idea how it got there!! Removed it and voila! Success! Well, mostly. I do receive: TS5069: Option 'declarationMap' cannot be specified without specifying option 'declaration' or option 'composite'.
But I can still serve and test so that's good!!
Great @spevilgenius !!! You always get to .yo-rc
files when you choose the create folder option. On in the folder you started and one exactly the same in the solution folder itself. Might some leftover.
What TypeScript generator have you chosen? That shows you this message.
That message was just when I ran gulp serve. I chose the 3.5 version of TypeScript but that's it. To be honest, I wish I could do it without TypeScript at all. Just so used to the vue cli and javascript files without the added weight of TypeScript. Just my 2 cents!
Yeah, understandable I currently think about maybe some future options to make the experience better.