GithubHelp home page GithubHelp logo

fastify / fastify-dx Goto Github PK

View Code? Open in Web Editor NEW
909.0 24.0 44.0 1.09 MB

Archived

JavaScript 78.29% CSS 3.07% HTML 0.84% Svelte 12.69% TypeScript 5.11%
fastify fastify-frontend react reactjs solid solidjs ssr svelte sveltejs vue

fastify-dx's Introduction

fastify-dx's People

Contributors

fdawgs avatar galvez avatar lu-zen avatar patrickheneise avatar rafaelgss avatar reconbot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fastify-dx's Issues

Add support for x-vhost HTTP header

Is your feature request related to a problem? Please describe.
There are cases where it is not possible to edit the host file (i.e., CI phase), but still, the multi-tenancy layer needs to work.

Describe the solution you'd like
Given the following app.mjs content:

export const tenants = {
  foo: 'foo.dev',
  bar: 'bar.dev',
}

it would be handy to configure a x-vhost HTTP header which will tell universify which tenant we want to reach:

curl -H "x-vhost: foo.dev" -X GET http://localhost:3000

Testing frameworks such as Cypress already support the possibility to add custom HTTP headers to their test calls.

Need to define a common configuration layer

Is your feature request related to a problem? Please describe.
One common problem when working with multi-tenant applications is that they might need a strong configuration layer containing information to be used at build time (i.e., when statically generating a webapp), or at runtime (i.e. endpoints, third-party plugin configurations, etc.).

It would be useful to propose a standard way to manage configurations for every tenant.

Describe the solution you'd like
In Krabs, we used to put all the configuration inside a .krabs.js file in the project's root:

module.exports = async () => ({
  tenants: [
    {
      name: 'website-1',
      // add any property here
      domains: [
        {
          development: /dev\.[a-z]*\.local\.website-1\.com/,
          staging: 'stage.website-1.com',
          production: 'website-1.com',
        },
      ],
    },
    {
      name: 'website-2',
      // add any property here
      domains: [
        {
          development: 'local.website-2.com',
          staging: 'stage.website-2.com',
          production: /[\w|\d|-|_]+\.website-2.com/,
        },
      ],
    },
  ],
});

It is important that the configurations can be retrieved asynchronously, as they can come from different data sources (CMSs, e-commerce platforms, etc.) and depend on the current environment (stage, dev, prod, test).

I'm not sure this is the right way to proceed in Universify, I'm open to discussions!

SQL Database Integration

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

๐Ÿš€ Feature Proposal

Fastify DX should provide easy integration with SQL databases.

Motivation

No response

Example

No response

Solid example not properly working

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.2.1

Plugin version

0.0.4

Node.js version

18.5.0

Operating system

Linux

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

Ubuntu 20.04.4 LTS x86_64

Description

In the Solid template, for some reason, the actions aren't working

Steps to Reproduce

Run the Solid example as instructed

Expected Behavior

All of the examples involving sending API requests to the server would work

bug: wrong file path when creating route in monorepo

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.11.0

Plugin version

@fastify/vite: ^3.0.4, @fastify/vue: ^@0.1.0

Node.js version

18.x

Operating system

Windows

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

10

Description

When building project inside monorepo, file path is wrong.

Error
vite v4.0.4 building for production...
โœ“ 11 modules transformed.
Could not resolve "./project/name/app/frontend/D:/project/name/app/frontend/src/pages/index.vue" from "../../../../../dx:routes.js"
file: /dx:routes.js
error during build:
RollupError: Could not resolve "./project/name/app/frontend/D:/project/name/app/frontend/src/pages/index.vue" from "../../../../../dx:routes.js"
    at error (file:///D:/project/name/node_modules/rollup/dist/es/shared/rollup.js:1967:30)
    at ModuleLoader.handleInvalidResolvedId (file:///D:/project/name/node_modules/rollup/dist/es/shared/rollup.js:23095:24)
    at file:///D:/project/name/node_modules/rollup/dist/es/shared/rollup.js:23058:26

Steps to Reproduce

  • Folder structure:
app/
|
|_backend/
|	|_package.json
|	|_src/
|
|_frontend/
|	|_vite.config.ts
|	|_client/
|
|_package.json
|_node_modules/
  • Step to reproduce: Run build command inside frontend folder.

Expected Behavior

Build success.

Revise URMA Rendering Options

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

๐Ÿš€ Feature Proposal

I was reading the rendering options and was wondering if they were exclusive of eachother? And if so maybe they should be a string union or enum?

Motivation

Prevents impossible states from happening.

Example

interface RouteModule {
  renderingMode?: 'server' | 'client' | 'isomorphic' // default is isomophic
  streaming?: boolean
  generated?: boolean // I noticed this wasn't documented
}

globalThis.Request is not a constructor

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

3.29.2

Plugin version

0.0.5

Node.js version

16.14.2

Operating system

macOS

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

11.6.6

Description

[vite] Error when evaluating SSR module /context.ts:
TypeError: globalThis.Request is not a constructor
at /fastify-dx-react-ts/node_modules/ky/distribution/core/constants.js:6:26
at /fastify-dx-react-ts/node_modules/ky/distribution/core/constants.js:17:3
at ModuleJob.run (node:internal/modules/esm/module_job:197:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:337:24)
at async importModuleDynamicallyWrapper (node:internal/vm/module:437:15)
at async nodeImport (/fastify-dx-react-ts/node_modules/fastify-vite/node_modules/vite/dist/node/chunks/dep-689425f3.js:724:749)
at async eval (/context.ts:3:31)
at async instantiateModule (/fastify-dx-react-ts/node_modules/fastify-vite/node_modules/vite/dist/node/chunks/dep-689425f3.js:722:2131)

Steps to Reproduce

Start from react-ts
Install missing dependencies vite & ky
run yarn build && yarn dev

Expected Behavior

Working starter

update to @fastify/vite

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

๐Ÿš€ Feature Proposal

fastify-vite is updated to @fastify/vite. so please update the fastify-dx version.

Motivation

No response

Example

No response

Error [ERR_MODULE_NOT_FOUND] when running npm run serve (solid-ts)

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

3.29.1

Plugin version

No response

Node.js version

16

Operating system

macOS

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

12.4

Description

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/steve/Downloads/fastify-dx-main/starters/solid-ts/client/dist/server/index.ts' imported from /Users/steve/Downloads/fastify-dx-main/starters/solid-ts/node_modules/fastify-vite/mode/production.js
    at __node_internal_captureLargerStackTrace (node:internal/errors:465:5)
    at new NodeError (node:internal/errors:372:5)
    at finalizeResolution (node:internal/modules/esm/resolve:437:11)
    at moduleResolve (node:internal/modules/esm/resolve:1009:10)
    at defaultResolve (node:internal/modules/esm/resolve:1218:11)
    at h (file:///Users/steve/Downloads/fastify-dx-main/starters/solid-ts/node_modules/@esbuild-kit/esm-loader/dist/index.js:1:2231)
    at U (file:///Users/steve/Downloads/fastify-dx-main/starters/solid-ts/node_modules/@esbuild-kit/esm-loader/dist/index.js:1:1350)
    at h (file:///Users/steve/Downloads/fastify-dx-main/starters/solid-ts/node_modules/@esbuild-kit/esm-loader/dist/index.js:1:2387)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ESMLoader.resolve (node:internal/modules/esm/loader:580:24)
    at async ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:7)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:437:15) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Steps to Reproduce

Run npm run build && npm run serve in solid-ts starter project.

Expected Behavior

No response

Are react-refresh issues solved?

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

Hi, I found a note in

// https://github.com/vitejs/vite/issues/3301#issuecomment-1080292430
about a vite bug with react fast-refresh breaking context changes. This should be fixed in the latest versions of the vite react plugin. Would you be wiling to try it out and check? (I'm not using this package, just poking around and I worked on the PR that fixed that bug).

Preact Support

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

๐Ÿš€ Feature Proposal

Is there any plans for a preact integration?
OFC we could use preact/compact

Motivation

No response

Example

No response

How to run code on the server

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

I'm playing around with this library to figure out how I would create something that I would normally use a SPA for.

Example

  • a Web UI with an HTTP API which the client invokes, runs something on the server and returns some results
  • let's also assume that what runs on the server cannot run on the client (e.g. a Node-only library which doesn't make sense running on the client)

What I did

  1. created a "API" module containing the code I would normally have in my backend API (let's say it's some Node.js code, e.g. DB access)
  2. created a new page which imports the API module
  3. set the page as server-only so that my API code doesn't run on the client
  4. use the API module in the getData export of the page module

Issues I encountered

  1. Vite cannot build the app because the API module cannot be built on the client (although the page where I use such code is set a serverOnly)
  2. Even assuming the API module code successfully builds on the client, how do I make it run on the server only, e.g. if it needs client inputs to run?

How to configure polymorphic fetch

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

In one of the starters there is a fetch function configured as

export const $fetch = ky.extend({
  prefixUrl: 'http://localhost:3000',
})

This doesn't work when the application is deployed somewhere as the server needs to "call itself" and the client needs go to the right url where the application is running.

How do you handle this?

Vue-router named route not working

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.11.0

Plugin version

0.1.0

Node.js version

16.3.1

Operating system

Linux

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

MacOS Ventura 13.1

Description

Navigating using vue-router named route is not working both during programmatic navigation and when using RouterLink component. This is because the name of the route is not passed when creating the routes here, https://github.com/fastify/fastify-dx/blob/main/packages/fastify-vue/virtual/routes.js#L33.

To fix, I will suggest adding name: routeDef.name here.

I can open a PR for this.

Steps to Reproduce

  • Clone fastify-dx/vue starter template
  • In the index.vue file, change the RouterLink component to use a named route instead of a path.

Expected Behavior

The application should navigate to a new route

cannot use the "usePayload" hook on fastify-vite-vue

on the the previous version, i use the usePayload as described in the docs:

import {usePayload} from 'fastify-vite-vue/core';

export default {
  components: {},
  setup() {
    const myData = usePayload()
    /// doing something..
    return {myData}
  }
}

on the new version I tried to import usePayload from both: fastify-vite-vue/blueprint/entry/core and /entry/core

both returned the same error:

โ„น at render (/my-app/node_modules/fastify-vite-vue/render.js:7:13)
โ„น at Object. (/my-app/node_modules/fastify-vite/mode/development.js:72:24)
โ„น at preHandlerCallback (/my-app/node_modules/fastify/lib/handleRequest.js:126:28)
โ„น at next (/my-app/node_modules/fastify/lib/hooks.js:158:7)
โ„น at handleResolve (/my-appnode_modules/fastify/lib/hooks.js:175:5)
โ„น at processTicksAndRejections (node:internal/process/task_queues:96:5)

is there a new way to use the payload behavior now?

Support <head> tag generation from SSR

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

Hello! I'm looking to check out fastify-dx but unsure with how to integrate with a UI library like mantine.dev. Any chance you could provide a little info on how to go about it? https://mantine.dev/theming/ssr/ has an example for generic integration with ssr.

Thanks in advance!

Specification

Fastify DX

Fastify DX is a CLI for rapid application development using the Fastify stack. It aims to offer many of the same functionalities found in Next.js, Nuxt.js and Remix, but instead of relying on deep runtime internals, focus on code generation and glue code for setting up and running Fastify projects, both in development and production.

Motivations

  • Effective SSR is locked away in black boxes today
    • Lots of buy-in into chosen framework is necessary
  • Companies often struggle scaling bringing Next.js apps to optimal performance
    • Next.js, Nuxt.js and Remix are all based on the Express middleware paradigm
  • Good chunk of projects still dependent on CRA/webpack
  • No de-facto solution for minimal (primitives only) SSR available

Features

  • Not a framework nor runtime, all generated code is pure Fastify and plugins
  • CLI web view with insights and logging filters for available sites
  • Out-of-the-box integrated hot reload for server with Vite app

Core

Packages that are part of the core boilerplate.

  • middie
  • fastify
  • fastify-redis (optional)
  • fastify-mongodb (optional)
  • fastify-postgresql (optional)
  • mercurius (optional)
  • fastify-api (optional)
  • fastify-vite
  • fastify-static

Commands

The CLI is meant to be installed globally, each command backed by zx script which can also be ejected and tweaked to meet custom project requirements.

  • fdx eject <boilerplate>: ejects boilerplate in its original format.
  • fdx apply: modifies current boilerplate but based on settings uni.config.js
  • fdx dev <site>: runs the specified site in development mode, or the last site ran.
  • fdx build <site>: runs the specified site in production mode
  • fdx start <site>: runs the specified site in production mode
  • fdx gen <site>: statically generates the specified site

The goal is to build up from fastify-cli with several DX oriented changes and additions, along with new and updated documentation.

Add support for environment-based domains

Is your feature request related to a problem? Please describe.
Domains can depend on the current environment. For example, when developing example.com, we might have the following domains:

  • Production: example.com
  • Staging: fix-JIRA-126300-somefix.user.staging.example.com
  • Development: local.example.com

Describe the solution you'd like
I'd propose to change the tenants configuration in app.mjs from this:

export const tenants = {
  foo: 'foo.dev',
  bar: 'bar.dev',
}

into something like this:

export const tenants = {
  foo: {
    dev: 'local.foo.dev',
    stage: /[\w]+\.foo\.dev/,
    prod: 'foo.dev'
  },
  // ...
}

Typically, the right domain gets selected by the NODE_ENV environment variable. Still, I find it quite repetitive to maintain hundreds of domains by hand-writing them in the format above, so I'm open to discussing a better solution!

This issue links to #3, as domains could depend on the configuration layer.

Static Site Generation

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

๐Ÿš€ Feature Proposal

Fastify DX should allow exporting a fully static or SPA bundle from the live application.

Motivation

No response

Example

No response

react starter template is missing ky package

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

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

Vue example not reactive + not detected by devtool

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

3

Plugin version

0.03

Node.js version

18

Operating system

macOS

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

Monterey 12.6

Description

I'm just trying out the vue ts example, everything works fine but vue is not reactive (i.e : the original data is displayed, but if I do a simple count++ it won't update. It is also not detected by vue devtool

I use a basic vue-ts example from the dev branch, the only thing I've changed is updating @vueuse/core to latest

Steps to Reproduce

Just install the basic vue example, try reactivity

Expected Behavior

No response

The solid example attempts to report an error

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

3.x

Plugin version

Node.js version

v16.15.0

Operating system

macOS

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

13

Description

~/Downloads/fastify-dx-main/starters/solid [16:53:09]

โžœ npm run dev

dev
node server.js --dev

node:internal/process/esm_loader:94
internalBinding('errors').triggerUncaughtException(
^

TypeError: globalThis.Request is not a constructor
at file:///Users/me/Downloads/fastify-dx-main/starters/solid/node_modules/ky/distribution/core/constants.js:6:26
at file:///Users/me/Downloads/fastify-dx-main/starters/solid/node_modules/ky/distribution/core/constants.js:17:3
at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
at async nodeImport (file:///Users/me/Downloads/fastify-dx-main/starters/solid/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:53137:21)
at async eval (/context.js:3:44)
at async instantiateModule (file:///Users/me/Downloads/fastify-dx-main/starters/solid/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:53058:9)

Steps to Reproduce

solid ็คบไพ‹็›ฎๅฝ•

npm install

npm run dev

Expected Behavior

No response

Package conflicts on npm install

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

3.0.0-beta.23

Plugin version

No response

Node.js version

16.13.0

Operating system

macOS

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

12.2

Description

Getting npm install conflicts using the default vue template

Steps to Reproduce

npx degit fastify/fastify-dx/starters/vue
npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: undefined@undefined
npm ERR! Found: [email protected]
npm ERR! node_modules/vue
npm ERR!   peer vue@"^3.2.25" from @vitejs/[email protected]
npm ERR!   node_modules/@vitejs/plugin-vue
npm ERR!     dev @vitejs/plugin-vue@"^2.3.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! @vueuse/core@"^8.7.4" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/vue
npm ERR!   peer vue@">= 2.5 < 3" from @vue/[email protected]
npm ERR!   node_modules/@vue/composition-api
npm ERR!     peerOptional @vue/composition-api@"^1.1.0" from @vueuse/[email protected]
npm ERR!     node_modules/@vueuse/core
npm ERR!       @vueuse/core@"^8.7.4" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 

Expected Behavior

No response

Solid HMR doesn't seem to work

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

3

Plugin version

0.0.4

Node.js version

16.15.1

Operating system

Windows

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

10

Description

HMR doesn't seem to be working with the Solid starter. If you make a change to a file, you can see in the console that vite is sending a hot update. However, you can see the entire app is unmounted and remounted to the dom when the update occurs.

Steps to Reproduce

install the solid starter, run dev environment and change any client file.

Expected Behavior

I expect the change to show in the browser without unmounting and remounting the main bundle

feat: provide typing

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

๐Ÿš€ Feature Proposal

Provide typing for all packages in this repo

Motivation

Currently, all packages in this repo doesn't provide typing and us developers would have to use @ts-expect-error and @ts-ignore to supress errors, which is very annoying.

Example

Inside vite.config.ts.

Fastify v4 Support

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.0.3

Plugin version

No response

Node.js version

16

Operating system

macOS

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

Monterey

Description

It appears fastify-static requires version 3.x of fastify

โฏ yarn build && yarn start
yarn run v1.22.17
warning package.json: No license field
$ npm run build:client && npm run build:server

> build:client
> vite build --outDir dist/client --ssrManifest

vite v2.9.12 building for production...
โœ“ 54 modules transformed.
dist/client/assets/logo.cc50e266.svg         6.08 KiB
dist/client/index.html                       0.31 KiB
dist/client/ssr-manifest.json                2.07 KiB
dist/client/assets/client-only.53046d16.js   0.67 KiB / gzip: 0.43 KiB
dist/client/assets/index.38341194.js         1.55 KiB / gzip: 0.70 KiB
dist/client/assets/server-only.59b389c3.js   0.62 KiB / gzip: 0.40 KiB
dist/client/assets/streaming.ac73764e.js     0.59 KiB / gzip: 0.37 KiB
dist/client/assets/using-auth.6c7bd58d.js    1.24 KiB / gzip: 0.73 KiB
dist/client/assets/using-store.c395d616.js   1.07 KiB / gzip: 0.65 KiB
dist/client/assets/using-data.cf228474.js    1.29 KiB / gzip: 0.75 KiB
dist/client/assets/index.aa422626.css        2.68 KiB / gzip: 0.81 KiB
dist/client/assets/index.b29a6f0d.js         97.19 KiB / gzip: 37.57 KiB

> build:server
> vite build --outDir dist/server --ssr /index.js

vite v2.9.12 building SSR bundle for production...
transforming (16) assets/logo.svg"defineAsyncComponent" is imported from external module "vue" but never used in "../../../../../dx:core.js", "client/pages/client-only.vue", "client/pages/server-only.vue", "client/pages/using-store.vue", "client/pages/using-data.vue", "client/pages/using-auth.vue", "client/pages/index.vue", "client/components/Message.vue", "client/pages/streaming.vue", "client/layouts/auth.vue", "client/layouts/default.vue", "../../../../../dx:layout.vue", "client/root.vue" and "../../../../../dx:create.js".
โœ“ 20 modules transformed.
dist/server/index.js   26.46 KiB
โœจ  Done in 1.95s.
yarn run v1.22.17
warning package.json: No license field
$ node server.js

/Users/sebastian/code/playground/fastify-vue/node_modules/fastify/lib/pluginUtils.js:118
    throw new FST_ERR_PLUGIN_VERSION_MISMATCH(meta.name, requiredVersion, this.version)
          ^
FastifyError [Error]: fastify-plugin: fastify-static - expected '3.x' fastify version, '4.0.3' is installed
    at Object.checkVersion (/Users/sebastian/code/playground/fastify-vue/node_modules/fastify/lib/pluginUtils.js:118:11)
    at Object.registerPlugin (/Users/sebastian/code/playground/fastify-vue/node_modules/fastify/lib/pluginUtils.js:133:16)
    at Boot.override (/Users/sebastian/code/playground/fastify-vue/node_modules/fastify/lib/pluginOverride.js:28:57)
    at Plugin.exec (/Users/sebastian/code/playground/fastify-vue/node_modules/avvio/plugin.js:80:33)
    at Boot.loadPlugin (/Users/sebastian/code/playground/fastify-vue/node_modules/avvio/plugin.js:273:10)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: 'FST_ERR_PLUGIN_VERSION_MISMATCH',
  statusCode: 500
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Steps to Reproduce

Run yarn build && yarn start on fresh install

Expected Behavior

No response

solid.js is not available

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

starters/solid can't run normally

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.