Skip to content
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

ERROR: SyntaxError: Unexpected end of JSON input while running npx staticshape@latest #6

Open
ccthecode opened this issue Sep 27, 2023 · 2 comments

Comments

@ccthecode
Copy link

ccthecode commented Sep 27, 2023

While running npx staticshape@latest, I get the error

FOLDER STRUCTURE

├───static-hugo
└───static-next
    ├───config.json
  • config.json was created before running the command and it's empty
  • My static site lives in static-next
  • I'm trying to output a Hugo site into static-hugo
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at file:///C:/Users/[USERNAME]/AppData/Local/npm-cache/_npx/9734112f603cd9ab/node_modules/staticshape/lib/index.js:122:21

BUILD LOG

npx staticshape@latest
(node:12020) ExperimentalWarning: The Node.js specifier resolution flag is experimental. It could change or be removed at any time.
(Use `node --trace-warnings ...` to show where the warning was created)
┌  Welcome to the StaticShape
│
◇  What folder contains your static site?
│  ./static-next
│
◆  Input set to C:\Users\[USERNAME]\code\js\portfolio-port\static-next
│
◇  Where is your staticshape config file?
│  ./config.json
│
◆  Input set to C:\Users\[USERNAME]\code\js\portfolio-port\config.json
│
◇  What folder should we output your SSG site?
│  ./_output/
│
◆  Input set to C:\Users\[USERNAME]\code\js\portfolio-port\_output
│
◇  What SSG would you like to use?
│  Hugo
│
▲  Something went wrong
undefined:2


SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at file:///C:/Users/[USERNAME]/AppData/Local/npm-cache/_npx/9734112f603cd9ab/node_modules/staticshape/lib/index.js:122:21
@ccthecode ccthecode changed the title ERROR: SyntaxError: Unexpected end of JSON input ERROR: SyntaxError: Unexpected end of JSON input while running npx staticshape@latest Sep 27, 2023
@ccthecode ccthecode changed the title ERROR: SyntaxError: Unexpected end of JSON input while running npx staticshape@latest **ERROR**: SyntaxError: Unexpected end of JSON input while running npx staticshape@latest Sep 27, 2023
@ccthecode ccthecode changed the title **ERROR**: SyntaxError: Unexpected end of JSON input while running npx staticshape@latest ERROR: SyntaxError: Unexpected end of JSON input while running npx staticshape@latest Sep 27, 2023
@georgephillips
Copy link
Contributor

Hey there 👋, thanks for trying out StaticShape. I have released a new version on npm to show a better error if your JSON is malformed. Can you try it out and let me know how it goes? If that doesn't work, can you provide your config.json?

@ccthecode
Copy link
Author

Hi @georgephillips, I truly appreciate your efforts.

So I added this to the config.json file and I now getting this ERROR:

▲  Something went wrong
file:///C:/Users/[USERNAME]/AppData/Local/npm-cache/_npx/9734112f603cd9ab/node_modules/staticshape/lib/collection.js:45
        let current = baseDoc.diff(documents[1]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants