Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First created app's config.compilerOptions applies to all later apps #9618

Closed
markrian opened this issue Nov 16, 2023 · 1 comment · Fixed by #9724 or #12019
Closed

First created app's config.compilerOptions applies to all later apps #9618

markrian opened this issue Nov 16, 2023 · 1 comment · Fixed by #9724 or #12019
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: compiler

Comments

@markrian
Copy link

markrian commented Nov 16, 2023

Vue version

3.3.8

Link to minimal reproduction

https://codepen.io/markrian/pen/JjxOmrw?editors=1011

Steps to reproduce

  1. Create two apps via createApp
  2. Configure the second one of them to use custom compilerOptions
  3. Observe those compilerOptions are ignored on the second app, as if you didn't set them.

OR

  1. Create two apps via createApp
  2. Configure the first one of them to use custom compilerOptions
  3. Observe those compilerOptions also apply (incorrectly) to the second app.

What is expected?

Each app should respect only its own compilerOptions.

What is actually happening?

It looks like apps share compilerOptions in some way.

System Info

No response

Any additional comments?

In my minimal reproduction I only test whitespace: 'preserve'. I don't actually know if it applies to all compilerOptions or just that one - I've made an assumption about the effects here.

@markrian
Copy link
Author

markrian commented Nov 16, 2023

Ah, I think I see what's going on here.

Apps share a cache of compiled templates, so the first app caches the generated render function, and the second app returns it.

Would it make more sense for each app to have its own compiler cache, for exactly this reason of differing compilerOptions? Or maybe splitting the cache based on compilerOptions?

@pikax pikax added scope: compiler 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels Nov 30, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: compiler
Projects
None yet
2 participants