-
-
Couldn't load subscription status.
- Fork 8.9k
Open
Labels
has workaroundA workaround has been found to avoid the problemA workaround has been found to avoid the problem🔩 p2-edge-case
Description
Vue version
3.4.27
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-pu2hgbvs?file=src%2Fcomponents%2FHelloWorldSetupPug.vue&terminal=dev
or
https://codesandbox.io/p/devbox/fast-cookies-75hgkn?file=%2Fsrc%2Fcomponents%2FHelloWorldSetupPug.vue%3A3%2C8&workspaceId=ws_QsAMR8rV8TbYxEA1u1WzFz
Steps to reproduce
- The reproduction includes four files:
HelloWorld,HelloWorldSetup,HelloWorldPug, andHelloWorldSetupPug.Setupindicates the use of the Composition API.Pugindicates the use of Pug.
- Run the reproduction in a browser with
pnpm install && pnpm dev. - Only
HelloWorldSetupPugtriggers the error, while the other files (HelloWorld,HelloWorldSetup, andHelloWorldPug) work fine. - The error appears when using
import { MyType } from "../utils/myUtils"inHelloWorldSetupPug. - Adding
typeto the import statement (import type { MyType } from "../utils/myUtils") resolves the issue.
What is expected?
All files, including HelloWorldSetupPug, should work without requiring type in the import statement if it is consistent with the behavior of the other files.
What is actually happening?
Only HelloWorldSetupPug throws the following error in the browser:
Uncaught SyntaxError: The requested module '/src/utils/myUtils.ts?t=1734061016288' does not provide an export named 'MyType'
This issue is resolved by adding type to the import statement.
System Info
System:
OS: macOS 14.6.1
CPU: (8) arm64 Apple M1
Memory: 65.95 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.20.2 - ~/.nvm/versions/node/v18.20.2/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 10.5.0 - ~/.nvm/versions/node/v18.20.2/bin/npm
pnpm: 8.7.6 - /usr/local/bin/pnpm
Browsers:
Chrome: 131.0.6778.140
Safari: 17.6
Safari Technology Preview: 18.0
npmPackages:
vue: ~3.4.27 => 3.4.38Any additional comments?
- This issue seems specific to the combination of Pug and the Composition API.
- The other files (
HelloWorld,HelloWorldSetup, andHelloWorldPug) work fine without addingtypein theimportstatement. - Is this behavior a bug in the setup or expected based on current configurations?
Metadata
Metadata
Assignees
Labels
has workaroundA workaround has been found to avoid the problemA workaround has been found to avoid the problem🔩 p2-edge-case