solidjs / solid-meta

Write meta tags to the document head
127 stars 16 forks source link

Error when upgrading from 0.28.7 to 0.29.0 or later in solidstart app #36

Closed stefankyriacou123 closed 10 months ago

stefankyriacou123 commented 10 months ago

Hi, when I upgrade my project to 0.29.0 or later (with all other solid/solidstart dependencies being on the latest versions - also i'm using the cloudflare adapter with wrangler and it's all running inside of a docker image baesd on node:lts using pnpm, if that matters), I get this error the first time any route is requested:

vc-dev        | ✘ [ERROR] [proxy]: An unhandled error occured: TypeError: __vite_ssr_import_0__.renderTags is not a function
vc-dev        | 
vc-dev        |       at eval (/app/node_modules/.pnpm/solid-start@0.3.8_@solidjs+meta@0.29.0_@solidjs+router@0.8.3_solid-js@1.8.5_solid-start-cloud_nbjebycphnygbptj4ztgnjri54/node_modules/solid-start/root/Meta.tsx:14:89)
vc-dev        |       at Array.<anonymous> (file:///app/node_modules/.pnpm/solid-js@1.8.5/node_modules/solid-js/web/dist/server.js:456:57)
vc-dev        |       at injectAssets (file:///app/node_modules/.pnpm/solid-js@1.8.5/node_modules/solid-js/web/dist/server.js:490:70)
vc-dev        |       at doShell (file:///app/node_modules/.pnpm/solid-js@1.8.5/node_modules/solid-js/web/dist/server.js:232:12)
vc-dev        |       at complete (file:///app/node_modules/.pnpm/solid-js@1.8.5/node_modules/solid-js/web/dist/server.js:245:9)
vc-dev        |       at Object.checkEnd [as onDone] (file:///app/node_modules/.pnpm/solid-js@1.8.5/node_modules/solid-js/web/dist/server.js:113:24)
vc-dev        |       at Y.onDone [as onDoneCallback] (file:///app/node_modules/.pnpm/seroval@0.12.0/node_modules/seroval/dist/esm/production/index.mjs:3:47199)
vc-dev        |       at Y.onDone (file:///app/node_modules/.pnpm/seroval@0.12.0/node_modules/seroval/dist/esm/production/index.mjs:3:41315)
vc-dev        |       at Y.popPendingState (file:///app/node_modules/.pnpm/seroval@0.12.0/node_modules/seroval/dist/esm/production/index.mjs:3:41447)
vc-dev        |       at file:///app/node_modules/.pnpm/seroval@0.12.0/node_modules/seroval/dist/esm/production/index.mjs:3:42783
vc-dev        |       at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
vc-dev        |   
vc-dev        | 
[proxy]: 1:36:30 PM [vite] ✨ new dependencies optimized: lucia, lucia/middleware, lucia/utils, @lucia-auth/adapter-mysql, kysely, kysely-planetscale, mysql2/promise, mjml, html-minifier, valibot, @solid-primitives/scheduled
vc-dev        | 1:36:30 PM [vite] ✨ optimized dependencies changed. reloading
vc-dev        | 

It's also probably worth noting that I haven't actually used the meta elements anywhere else in my project, so they are only in the src/root.tsx file as is initially generated with a solidstart project; and that file looks like this:

// @refresh reload
import { Suspense, type Component } from "solid-js"
import {
  Body,
  ErrorBoundary,
  FileRoutes,
  Head,
  Html,
  Meta,
  Routes,
  Scripts,
  Title,
} from "solid-start"

import "./root.css"

const Root: Component = () => <Html lang="en" class="h-full bg-base-300">
  <Head>
    <Title>Vanilla Coding</Title>
    <Meta charset="utf-8" />
    <Meta name="viewport" content="width=device-width, initial-scale=1" />
  </Head>
  <Body>
    <ErrorBoundary>
      <Suspense fallback={<div>Loading</div>}>
        <Routes><FileRoutes /></Routes>
      </Suspense>
    </ErrorBoundary>
    <Scripts />
  </Body>
</Html>

export default Root

And if it's relevant, this is the dockerfile that the project is being run with:

FROM node:lts

RUN npm install --global pnpm@latest

WORKDIR /app

COPY . .
RUN pnpm install

ENV HOST=0.0.0.0
ENV PORT=3000

EXPOSE 3000
CMD ["pnpm", "exec", "wrangler", "pages", "dev", "--compatibility-date=2023-10-10", "--proxy", "3000", "--", "pnpm", "exec", "solid-start", "dev"]

And these are the dependencies and devDependencies:

  "dependencies": {
    "@lucia-auth/adapter-mysql": "2.1.0",
    "@planetscale/database": "1.11.0",
    "@solidjs/meta": "0.29.0",
    "@solidjs/router": "0.8.3",
    "@solid-primitives/scheduled": "1.4.1",
    "html-minifier": "4.0.0",
    "kysely": "0.26.3",
    "kysely-planetscale": "1.4.0",
    "lucia": "2.7.2",
    "mjml": "4.14.1",
    "mysql2": "3.6.2",
    "solid-js": "1.8.5",
    "solid-start": "0.3.8",
    "valibot": "0.20.0"
  },
  "devDependencies": {
    "@types/babel__core": "7.20.3",
    "@types/html-minifier": "4.0.4",
    "@types/mjml": "4.7.3",
    "autoprefixer": "10.4.16",
    "daisyui": "3.9.4",
    "esbuild": "0.19.5",
    "kysely-codegen": "0.11.0",
    "postcss": "8.4.31",
    "rollup": "4.2.0",
    "solid-start-cloudflare-pages": "0.3.8",
    "solid-start-node": "0.3.8",
    "tailwindcss": "3.3.5",
    "typescript": "5.2.2",
    "vite": "4.5.0",
    "wrangler": "3.15.0"
  },

Apologies if i've provided pointless information, or if i'm missing information as I don't fully understand what the problem is.

stefankyriacou123 commented 10 months ago

An update has been released for solid-start to fix this, upgrade solid-start to 0.3.9 and everything should work.