-
Notifications
You must be signed in to change notification settings - Fork 90
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
Commonjs plugin is run on typescript definition files #135
Labels
bug
Something isn't working
Comments
This was referenced Oct 18, 2022
The error occurs since these changes with 0.9.2. Diff: v0.9.1...v0.9.2 |
It might work if you add the related dependency to the Related: Lines 147 to 153 in 818ced7
|
Add the respectExternal configuration to false |
Same issue when importing ofetch types: import type { FetchOptions } from 'ofetch' SyntaxError: Unexpected token (1:12) in /Users/tarasbatenkov/Projects/nuxt-test-module/node_modules/.pnpm/ofetch@1.3.3/node_modules/ofetch/dist/index.d.ts
at pp$4.raise (file:///Users/tarasbatenkov/Projects/nuxt-test-module/node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:21616:13)
at pp$9.unexpected (file:///Users/tarasbatenkov/Projects/nuxt-test-module/node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:18824:8)
at pp$9.expectContextual (file:///Users/tarasbatenkov/Projects/nuxt-test-module/node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:18778:41)
at Parser.parseImport (file:///Users/tarasbatenkov/Projects/nuxt-test-module/node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:26122:14)
at pp$8.parseStatement (file:///Users/tarasbatenkov/Projects/nuxt-test-module/node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:19000:49)
at pp$8.parseTopLevel (file:///Users/tarasbatenkov/Projects/nuxt-test-module/node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:18881:21)
at Parser.parse (file:///Users/tarasbatenkov/Projects/nuxt-test-module/node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:18653:15)
at Function.parse (file:///Users/tarasbatenkov/Projects/nuxt-test-module/node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:18703:35)
at Graph.contextParse (file:///Users/tarasbatenkov/Projects/nuxt-test-module/node_modules/.pnpm/rollup@3.29.2/node_modules/rollup/dist/es/shared/node-entry.js:25749:38)
at tryParse (file:///Users/tarasbatenkov/Projects/nuxt-test-module/node_modules/.pnpm/@rollup+plugin-commonjs@25.0.4_rollup@3.29.2/node_modules/@rollup/plugin-commonjs/dist/es/index.js:17:12) {
pos: 12,
loc: {
column: 12,
file: '/Users/tarasbatenkov/Projects/nuxt-test-module/node_modules/.pnpm/ofetch@1.3.3/node_modules/ofetch/dist/index.d.ts',
line: 1
},
raisedAt: 13,
frame: "1: import type { $ as $Fetch } from './shared/ofetch.441891d5.js';\n" +
' ^\n' +
'2: export type { C as CreateFetchOptions, b as FetchContext, e as FetchError, c as FetchOptions, F as FetchRequest, a as...',
id: '/Users/tarasbatenkov/Projects/nuxt-test-module/node_modules/.pnpm/ofetch@1.3.3/node_modules/ofetch/dist/index.d.ts',
hook: 'resolveId',
code: 'PLUGIN_ERROR',
plugin: 'commonjs--resolver',
watchFiles: [
'/Users/tarasbatenkov/Projects/nuxt-test-module/src/module.ts',
'/Users/tarasbatenkov/Projects/nuxt-test-module/src/utils.ts',
'/Users/tarasbatenkov/Projects/nuxt-test-module/src/runtime/plugin.ts',
'/Users/tarasbatenkov/Projects/nuxt-test-module/src/runtime/composables/useOpenFetchOptions.ts',
'/Users/tarasbatenkov/Projects/nuxt-test-module/src/clients.ts',
'/Users/tarasbatenkov/Projects/nuxt-test-module/node_modules/.pnpm/ofetch@1.3.3/node_modules/ofetch/dist/index.d.ts'
]
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using
import type { WithRequired } from '@apollo/utils.withrequired'
in a file that is processed withunbuild
yields the following error:I think the issue lies in
unbuild/src/builder/rollup.ts
Lines 237 to 240 in da197ec
Reproduction: apollo-server-integrations/apollo-server-integration-h3#12
The text was updated successfully, but these errors were encountered: