iles icon indicating copy to clipboard operation
iles copied to clipboard

iles using a named export from vue/transformer-sfc that does not exist

Open jmegs opened this issue 1 year ago • 11 comments

Description 📖

iles using a named export from vue/transformer-sfc that does not exist

Dependencies Info
iles v0.9.5 | vite v4.5.1

- [email protected]
- [email protected]
- [email protected]

Logs 📜

If not providing a reproduction:

Output
$ DEBUG=iles:* npm run dev

> [email protected] dev
> iles dev --open

file:///Users/jmeguerian/Code/tmp/iles-app/node_modules/iles/dist/node/chunk-IMB7AIW2.js:63
import { shouldTransformRef, transformRef } from "vue/compiler-sfc";
                             ^^^^^^^^^^^^
SyntaxError: The requested module 'vue/compiler-sfc' does not provide an export named 'transformRef'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:132:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:214:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async executeCommand (file:///Users/jmeguerian/Code/tmp/iles-app/node_modules/iles/dist/node/cli.js:25:30)

Node.js v21.1.0

jmegs avatar Jan 12 '24 20:01 jmegs

I'm seeing the same thing.

ohuu avatar Jan 21 '24 00:01 ohuu

It looks like transformRef was removed in vue 3.4. See line 15 here

My nasty hack of a workaround is to fiddle my package-lock to force vue 3.3.

It seems from this commit (lines 73-78) that shouldTransformRef is hardcoded to return false, suggesting that this functionality is no longer needed and we can remove all references to transformRef in iles?

ohuu avatar Jan 21 '24 16:01 ohuu

Thanks for reporting, I'll remove usage of transformRef in the next release.


The reactivityTransform proposal has been removed in Vue 3.4, but it's usable through a third-party plugin.

I think the reactivity transform remains a nicer dialect when using script setup, especially once Vue introduced the ability for watch to receive a getter, which addressed some of the DX concerns such as having to use $$().

However, it's better to let the user make that decision on their own (custom Vite plugins can be added easily in iles.config.ts).

ElMassimo avatar Jan 22 '24 18:01 ElMassimo

Do you have an ETA? Right now a fresh iles instance is broken right after install. I tried to massage my package lock into working but was less successful than @ohuu

This also fixes #242

therealshark avatar Feb 06 '24 20:02 therealshark

Hey @ElMassimo I'd really like to contribute to Iles, maybe this would be a good issue to tackle but I'd need some onboarding to the project. Is there any docs which would help me to setup a dev environment so I can start working on it?

ohuu avatar Feb 15 '24 22:02 ohuu

Hi Oliver! That would be great! 😃

I haven't written an onboarding guide to the project itself, but typically all you need is a modern Node version (20, for example), and pnpm to install dependencies for the entire project.

Building packages can be done by running pnpm run build inside each package, or pnpm run dev to keep a daemon running to rebuild the package as you change the source code.

ElMassimo avatar Feb 16 '24 18:02 ElMassimo

~~Hey folks, have the same issue would love to see some workaround examples. Not sure how to approach package-lock to force vue 3.3? Unless there are more elegant solutions...~~

Ninja edit: As per https://github.com/Pinegrow/pg-iles-vuetify/issues/1#issuecomment-1953343698 Adding this to package.json works, thank you!

"pnpm": {
    "overrides": {
      "vue": "3.3",
      "vite": "4.4"
    }
  }

peterstnsz avatar Jun 29 '24 12:06 peterstnsz