Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Can't import from /dist directory in v11 #3764

@sebakerckhof

Description

@sebakerckhof

Describe the bug
In v11 there has been an exports property added to the package.json file.

This makes it so that we can't import from the /dist folder anymore (using vite as dev/build tool).

To Reproduce
Install converse v11 in a vite project
Try some imports like:
import 'converse.js/dist/converse.min.css';

which gives the following error:

Missing "./dist/converse.min.css" specifier in "converse.js" package

Also just regalary importing converse, e.g.
import 'converse.js';

throws a whole range of errors like:


 [ERROR] Could not resolve "shared/chat/utils.js"

    node_modules/converse.js/src/plugins/controlbox/templates/controlbox.js:3:29:
      3 │ import { getChatStyle } from 'shared/chat/utils.js';
        ╵                              ~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "shared/chat/utils.js" as external to exclude it from the bundle, which will
  remove this error and leave the unresolved path in the bundle.

So I'm not sure how to use v11 using the npm package?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions