fastify / fastify-dx

Archived
900 stars 42 forks source link

react starter template is missing ky package #13

Closed lu-zen closed 2 years ago

lu-zen commented 2 years ago

Prerequisites

Fastify version

3.29.0

Plugin version

0.0.1

Node.js version

16.14.2

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

EndeavourOS 22.1

Description

The react starter template is missing ky package, it needs to be installed alongside ky-universal.

Console output:

$ node server.js --dev
Sourcemap for "/dx:base.jsx" points to missing source files
Sourcemap for "/dx:router.jsx" points to missing source files
20:55:41 [vite] Error when evaluating SSR module /context.js:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'ky' imported from /home/user/playground/fastify-dx-react/node_modules/ky-universal/index.js
    at new NodeError (node:internal/errors:371:5)
    at packageResolve (node:internal/modules/esm/resolve:932:9)
    at moduleResolve (node:internal/modules/esm/resolve:978:18)
    at defaultResolve (node:internal/modules/esm/resolve:1080:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:530:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:251:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:79:40)
    at link (node:internal/modules/esm/module_job:78:36)
node:internal/process/esm_loader:94
    internalBinding('errors').triggerUncaughtException(
                              ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'ky' imported from /home/user/playground/fastify-dx-react/node_modules/ky-universal/index.js
    at new NodeError (node:internal/errors:371:5)
    at packageResolve (node:internal/modules/esm/resolve:932:9)
    at moduleResolve (node:internal/modules/esm/resolve:978:18)
    at defaultResolve (node:internal/modules/esm/resolve:1080:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:530:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:251:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:79:40)
    at link (node:internal/modules/esm/module_job:78:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Steps to Reproduce

  1. Clone the react starter template;
  2. Run yarn;
  3. Run yarn dev;

Expected Behavior

No response

seSze commented 2 years ago

the same applies to vue

❯ yarn dev
yarn run v1.22.17
warning package.json: No license field
$ node server.js --dev
23:58:28 [vite] Error when evaluating SSR module /context.js:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'ky' imported from /Users/sebastian/code/playground/fastify-vue/node_modules/ky-universal/index.js
    at new NodeError (node:internal/errors:371:5)
    at packageResolve (node:internal/modules/esm/resolve:884:9)
    at moduleResolve (node:internal/modules/esm/resolve:929:18)
    at defaultResolve (node:internal/modules/esm/resolve:1044:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:422:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
    at link (node:internal/modules/esm/module_job:75:36)
node:internal/process/esm_loader:94
    internalBinding('errors').triggerUncaughtException(
                              ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'ky' imported from /Users/sebastian/code/playground/fastify-vue/node_modules/ky-universal/index.js
    at new NodeError (node:internal/errors:371:5)
    at packageResolve (node:internal/modules/esm/resolve:884:9)
    at moduleResolve (node:internal/modules/esm/resolve:929:18)
    at defaultResolve (node:internal/modules/esm/resolve:1044:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:422:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
    at link (node:internal/modules/esm/module_job:75:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
galvez commented 2 years ago

Good catch — thank you, I'll update the starter template's package.json!

macjabeth commented 2 years ago

Hey @galvez - love what you're doing with this project. :)

I'm not sure if this is still an ongoing fix or not, but I'm still seeing this error when I attempt to use the starter.

2022-08-29 at 11 03 44@2x

CanRau commented 2 years ago

Had to manually install ky as well. still can't get it working, but might open another issue 😅