natemoo-re / microsite

Do more with less JavaScript. Microsite is a smarter, performance-obsessed static site generator powered by Preact and Snowpack.

Home Page:https://npm.im/microsite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when trying to run project

lucaslevin opened this issue · comments

My steps:

  • npm init microsite microsite
  • cd /microsite
  • yarn install
  • yarn start

➜ microsite yarn start
yarn run v1.22.10
warning ../../package.json: No license field
$ microsite
file:///##/##/##/microsite/node_modules/microsite/dist/cli/microsite-dev.js:53
const [errs, config] = await loadConfiguration('dev');
^

TypeError: (intermediate value) is not iterable
at dev (file:///##/##/##/microsite/node_modules/microsite/dist/cli/microsite-dev.js:53:28)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Just downloaded, ran init and then tried starting the dev server. This was the result:

(node:251078) UnhandledPromiseRejectionWarning: TypeError: (intermediate value) is not iterable
    at dev (file:///home/andrew/.nvm/versions/node/v14.15.3/lib/node_modules/microsite/dist/cli/microsite-dev.js:54:28)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:251078) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:251078) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Did the same thing as above, same error with both node v12.9.1 and v14.15.4

yarn run v1.22.5
$ microsite
(node:20267) UnhandledPromiseRejectionWarning: TypeError: (intermediate value) is not iterable
    at dev (file:///Users/nilskjellman/xxx/xxx/microjazz/node_modules/microsite/dist/cli/microsite-dev.js:53:28)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:20267) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:20267) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
✨  Done in 0.65s.
nilskjellman@Nilss-MBP-2 microjazz % node --version
v14.15.4```

microsite depends on snowpack@^3.0.0-rc.2 and resolves snowpack@3.0.10 at the moment.
Snowpack changed createConfiguration API.

Sorry about this, everybody!

As a silly workaround yarn users could add the following to their package.json.

  "resolutions": {
    "microsite/snowpack": "3.0.0-rc.2"
  }

There are a few things happening here:

  • I should have pinned the dependency to snowpack@3.0.0-rc.2 exactly (for multiple reasons.) It was probably not a great idea to depend on an rc anyway.
  • There were a number of breaking changes with snowpack@3.0.0 that didn't make it into an rc ahead of time. Some pretty straightforward but others were more subtle. Without the advance warning, those caught me off guard.
  • I merged 1.1.0-next into Microsite's main branch, so that blocked me from putting a quick patch out. Lesson learned!

Hoping to get v1.1.0 out the door very soon. Feel free to follow #94.

Sorry for the frustration, everybody! You should now be able to manually install microsite@next with any package manager to fix this (and yarn users can remove the resolutions workaround.)

microsite@1.1.0 is still waiting on snowpack@3.0.12, but unfortunately there hasn't been a Snowpack release for about a month. As soon as that drops, Microsite is ready to go out the door.