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

Virtual Svelte module ids should start with \0 #274

Closed
5 tasks done
IanVS opened this issue Mar 14, 2023 · 1 comment
Closed
5 tasks done

Virtual Svelte module ids should start with \0 #274

IanVS opened this issue Mar 14, 2023 · 1 comment

Comments

@IanVS
Copy link
Contributor

IanVS commented Mar 14, 2023

Describe the bug

This tool creates virtual modules for svelte, which can cause problems for other plugins which attempt to load those files, not realizing they are virtual. The plugin documentation for rollup specifies:

If your plugin uses 'virtual modules' (e.g. for helper functions), prefix the module ID with \0. This prevents other plugins from trying to process it.

So, should virtual modules created when unplugin-icons is configured with compiler: "svelte" be prefixed? Or is there another way that other plugins should detect these are virtual modules, ideally without hitting the filesystem?

See storybookjs/storybook#20562 for the issue in Storybook.

Reproduction

https://github.com/enyo/storybook-test/tree/main/my-app

System Info

System:
    OS: macOS 13.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 16.05 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    Yarn: 3.4.1 - ~/.yarn/bin/yarn
    npm: 8.12.1 - ~/.nvm/versions/node/v16.14.2/bin/npm
  Browsers:
    Brave Browser: 111.1.49.120
    Firefox: 110.0.1
    Safari: 16.2

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@antfu
Copy link
Member

antfu commented Mar 15, 2023

I feel that it's best for integrations to be able to process virtual modules. As in this case, our virtual module is mean to be processed by other plugins (we serve raw components).

@IanVS IanVS closed this as completed Mar 15, 2023
@IanVS IanVS closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants