solidjs / templates

Vite + solid templates
446 stars 117 forks source link

ReferenceError: dist/components.jsx: transformCondition is not defined #69

Closed carcinocron closed 1 year ago

carcinocron commented 2 years ago
vite v3.1.8 building for production...
✓ 6 modules transformed.
[solid] /Users/crab/code/solidjs-ts-router/node_modules/solid-app-router/dist/components.jsx: transformCondition is not defined
file: /Users/crab/code/solidjs-ts-router/node_modules/solid-app-router/dist/components.jsx
error during build:
ReferenceError: /Users/crab/code/solidjs-ts-router/node_modules/solid-app-router/dist/components.jsx: transformCondition is not defined
    at /Users/crab/code/solidjs-ts-router/node_modules/babel-plugin-jsx-dom-expressions/index.js:1463:26
    at Array.forEach (<anonymous>)
    at processSpreads$1 (/Users/crab/code/solidjs-ts-router/node_modules/babel-plugin-jsx-dom-expressions/index.js:1424:14)
    at transformAttributes$2 (/Users/crab/code/solidjs-ts-router/node_modules/babel-plugin-jsx-dom-expressions/index.js:760:32)
    at transformElement$3 (/Users/crab/code/solidjs-ts-router/node_modules/babel-plugin-jsx-dom-expressions/index.js:624:3)
    at transformElement (/Users/crab/code/solidjs-ts-router/node_modules/babel-plugin-jsx-dom-expressions/index.js:3145:12)
    at transformNode (/Users/crab/code/solidjs-ts-router/node_modules/babel-plugin-jsx-dom-expressions/index.js:3034:12)
    at PluginPass.transformJSX (/Users/crab/code/solidjs-ts-router/node_modules/babel-plugin-jsx-dom-expressions/index.js:2995:18)

this occurs on a fresh run of:

npx degit solidjs/templates/ts-router solidjs-ts-router
cd solidjs-ts-router
npm i
npm run build
$ node -v
v14.19.0
$ uname -a
Darwin REDACTED.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64 x86_64
chimp1nski commented 2 years ago

This also happens to me with npm init solid. I was looking forward to trying out solid/start today :/

Node v18.11.0

    "@solidjs/meta": "^0.28.0",
    "@solidjs/router": "^0.5.0",
    "solid-js": "^1.6.0",
    "solid-start": "^0.1.8",

Edit

This only happens when using npm. When I use pnpm the error doesn't appear, and everything works as intended.

carcinocron commented 2 years ago

I'll confirm that yarn worked.

amoutonbrady commented 1 year ago

Hey, thanks for filling out an issue.

It seems like it's a MacOS related issue. Unfortunately, I don't have a MacOS system available for myself so I won't be able to be helping you much here. Maybe you could try to upgrade your node version to at least node 16?

For the record, I ran the exact same steps on Windows and didn't run into bumps:

C:\Users\amout\Lab: node -v                                                                                                                                               
v14.21.2
C:\Users\amout\Lab: pnpm dlx degit solidjs/templates/ts-router solidjs-ts-router                                                                                          
.../Local/pnpm/store/v3/tmp/dlx-16492    |   +1 +
.../Local/pnpm/store/v3/tmp/dlx-16492    | Progress: resolved 1, reused 1, downloaded 0, added 1, done
> cloned solidjs/templates#HEAD to solidjs-ts-router
C:\Users\amout\Lab: cd solidjs-ts-router\                                                                                                                                 C:\Users\amout\Lab\solidjs-ts-router: npm i                                                                                                                               

> esbuild@0.16.17 postinstall C:\Users\amout\Lab\solidjs-ts-router\node_modules\esbuild
> node install.js

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules\vite\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN notsup Unsupported engine for rollup@3.13.0: wanted: {"node":">=14.18.0","npm":">=8.0.0"} (current: {"node":"14.21.2","npm":"6.14.17"})
npm WARN notsup Not compatible with your version of node/npm: rollup@3.13.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/android-arm@0.16.17 (node_modules\esbuild\node_modules\@esbuild\android-arm):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/android-arm@0.16.17: wanted {"os":"android","arch":"arm"} (current: {"os":"win32","arch":"x64"})
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/android-arm64@0.16.17: wanted {"os":"android","arch":"arm64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/freebsd-arm64@0.16.17 (node_modules\esbuild\node_modules\@esbuild\freebsd-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/freebsd-arm64@0.16.17: wanted {"os":"freebsd","arch":"arm64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/darwin-x64@0.16.17 (node_modules\esbuild\node_modules\@esbuild\darwin-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/darwin-x64@0.16.17: wanted {"os":"darwin","arch":"x64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/linux-arm@0.16.17 (node_modules\esbuild\node_modules\@esbuild\linux-arm):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/linux-arm@0.16.17: wanted {"os":"linux","arch":"arm"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/android-x64@0.16.17 (node_modules\esbuild\node_modules\@esbuild\android-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/android-x64@0.16.17: wanted {"os":"android","arch":"x64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/linux-ia32@0.16.17 (node_modules\esbuild\node_modules\@esbuild\linux-ia32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/linux-ia32@0.16.17: wanted {"os":"linux","arch":"ia32"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/darwin-arm64@0.16.17 (node_modules\esbuild\node_modules\@esbuild\darwin-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/darwin-arm64@0.16.17: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/linux-arm64@0.16.17 (node_modules\esbuild\node_modules\@esbuild\linux-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/linux-arm64@0.16.17: wanted {"os":"linux","arch":"arm64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/freebsd-x64@0.16.17 (node_modules\esbuild\node_modules\@esbuild\freebsd-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/freebsd-x64@0.16.17: wanted {"os":"freebsd","arch":"x64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/linux-loong64@0.16.17 (node_modules\esbuild\node_modules\@esbuild\linux-loong64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/linux-loong64@0.16.17: wanted {"os":"linux","arch":"loong64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/linux-ppc64@0.16.17 (node_modules\esbuild\node_modules\@esbuild\linux-ppc64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/linux-ppc64@0.16.17: wanted {"os":"linux","arch":"ppc64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/linux-x64@0.16.17 (node_modules\esbuild\node_modules\@esbuild\linux-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/linux-x64@0.16.17: wanted {"os":"linux","arch":"x64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/linux-mips64el@0.16.17 (node_modules\esbuild\node_modules\@esbuild\linux-mips64el):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/linux-mips64el@0.16.17: wanted {"os":"linux","arch":"mips64el"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/linux-riscv64@0.16.17 (node_modules\esbuild\node_modules\@esbuild\linux-riscv64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/linux-riscv64@0.16.17: wanted {"os":"linux","arch":"riscv64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/openbsd-x64@0.16.17 (node_modules\esbuild\node_modules\@esbuild\openbsd-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/openbsd-x64@0.16.17: wanted {"os":"openbsd","arch":"x64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/linux-s390x@0.16.17 (node_modules\esbuild\node_modules\@esbuild\linux-s390x):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/linux-s390x@0.16.17: wanted {"os":"linux","arch":"s390x"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/sunos-x64@0.16.17 (node_modules\esbuild\node_modules\@esbuild\sunos-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/sunos-x64@0.16.17: wanted {"os":"sunos","arch":"x64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/win32-arm64@0.16.17 (node_modules\esbuild\node_modules\@esbuild\win32-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/win32-arm64@0.16.17: wanted {"os":"win32","arch":"arm64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/netbsd-x64@0.16.17 (node_modules\esbuild\node_modules\@esbuild\netbsd-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/netbsd-x64@0.16.17: wanted {"os":"netbsd","arch":"x64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/win32-ia32@0.16.17 (node_modules\esbuild\node_modules\@esbuild\win32-ia32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/win32-ia32@0.16.17: wanted {"os":"win32","arch":"ia32"} (current: {"os":"win32","arch":"x64"})
npm WARN vite-template-solid@0.0.0 No repository field.

added 116 packages from 110 contributors and audited 138 packages in 7.699s

17 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

C:\Users\amout\Lab\solidjs-ts-router: npm run build                                                                                                                       

> vite-template-solid@0.0.0 build C:\Users\amout\Lab\solidjs-ts-router
> vite build

vite v4.1.1 building for production...
✓ 19 modules transformed.
dist/index.html                  0.51 kB
dist/assets/index-f879dcd7.css   3.52 kB │ gzip:  1.21 kB
dist/assets/404-1587bd2f.js      0.23 kB │ gzip:  0.21 kB
dist/assets/about-5960a67d.js    0.62 kB │ gzip:  0.39 kB
dist/assets/index-edc1ee22.js   31.87 kB │ gzip: 12.49 kB
carcinocron commented 1 year ago

I am not currently experiencing this issue under node 18 (on a newer Mac). Maybe node14 or the npm version on my previous Mac is too old for solidjs.