Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Extension npm build : Invalid value for option "output.file" #10890

Closed
3 tasks done
AlphaMoonbaseBerlin opened this issue Jan 6, 2022 · 0 comments
Closed
3 tasks done

Comments

@AlphaMoonbaseBerlin
Copy link

AlphaMoonbaseBerlin commented Jan 6, 2022

Preflight Checklist

Describe the Bug

I try to implement jspdf into a custom-endpoint.
When trying to build the extension, rollup throws the following error:

Error: Invalid value for option "output.file" - when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option.

This seems to indikate that the rollup-implementation as set up to package everything into a single file.

I digged arround a little bit into the script and found that there is the chance to create a extensions.config.js to pass data to rollup. But trying to force it to either use dir-mode instead of file-mode or allowing inlineDynamicImports does not seem to work as intendet as in it does not have any effect. But maybe I'm missing some part here in how to setup the extensions.config.js correctly to pass that information:

export default {
    output: {
        dir: './dist'
      },
  }

Maybe this is not per se a bug but a feature-request or asking for en enhancment of the docs in regards to the rollup-config.

To Reproduce

npm install jspdf

index.js:
import { jsPDF } from "jspdf";

npm run build

Errors Shown

✖ Failed

Error: Invalid value for option "output.file" - when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option.
[Error] https://rollupjs.org/guide/en/#outputdir
Error: Invalid value for option "output.file" - when building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option.

What version of Directus are you using?

What version of Node.js are you using?

14.7.0

What database are you using?

What browser are you using?

What operating system are you using?

Windows 10

How are you deploying Directus?

@AlphaMoonbaseBerlin AlphaMoonbaseBerlin changed the title Invalid value for option "output.file" Extension npm build : Invalid value for option "output.file" Jan 6, 2022
@directus directus locked and limited conversation to collaborators Jan 6, 2022
@rijkvanzanten rijkvanzanten converted this issue into discussion #10893 Jan 6, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant