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

[dev-server-rollup] TypeError: Cannot destructure property 'skipSelf' of 'options' as it is undefined. #2640

Open
eight04 opened this issue Feb 15, 2024 · 0 comments

Comments

@eight04
Copy link

eight04 commented Feb 15, 2024

Error while handling server request.
TypeError: Cannot destructure property 'skipSelf' of 'options' as it is undefined.
    at Object.resolve (C:\Users\eight04\dev\linkify-plus-plus-core\node_modules\@web\dev-server-rollup\dist\createRollupPluginContextAdapter.js:66:21)
    at Object.importStyle (C:\Users\eight04\dev\linkify-plus-plus-core\node_modules\rollup-plugin-cjs-es\index.js:174:35)
    at context.isImportPreferDefault (C:\Users\eight04\dev\linkify-plus-plus-core\node_modules\cjs-es\lib\context.js:17:38)
    at writeImport (C:\Users\eight04\dev\linkify-plus-plus-core\node_modules\cjs-es\lib\import-writer.js:33:15)
    at Array.map (<anonymous>)
    at Object.write (C:\Users\eight04\dev\linkify-plus-plus-core\node_modules\cjs-es\lib\import-writer.js:26:50)
    at Object.write (C:\Users\eight04\dev\linkify-plus-plus-core\node_modules\cjs-es\lib\writer.js:18:35)
    at transform (C:\Users\eight04\dev\linkify-plus-plus-core\node_modules\cjs-es\index.js:28:31)
    at async Object.transform (C:\Users\eight04\dev\linkify-plus-plus-core\node_modules\rollup-plugin-cjs-es\index.js:169:20)
    at async Object.transform (C:\Users\eight04\dev\linkify-plus-plus-core\node_modules\@web\dev-server-rollup\dist\rollupAdapter.js:293:34)

Thrown by this line

const { skipSelf, ...resolveOptions } = options;

I guess the signature of resolve is wrong? According to https://rollupjs.org/plugin-development/#this-resolve, it should probably be

-    async resolve(source: string, importer: string, options: ResolveOptions) {
+    async resolve(source: string, importer?: string, options?: ResolveOptions) {

The caller: https://github.com/eight04/rollup-plugin-cjs-es/blob/7243715be4166b908fb2aa71f664475b5cbbd90e/index.js#L174

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

1 participant