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

Can't import the named export {_method_} from non EcmaScript module (only default export is available) #2

Closed
Lightlce opened this issue Jul 17, 2022 · 1 comment

Comments

@Lightlce
Copy link

Hi team,

Currently I'm facing this error using the toHTML methods.
On some quick search, google suggests this is something to do with the webpack configuration.

Is there an additional step required to use this module?

image

implementation.vue

import { toHTML } from '@portabletext/to-html'
//...

somefunction():
//do something

return {
    toHTML(someBlockContent, { components: {} }),
}
@Lightlce
Copy link
Author

This resolved for me.

vuejs/pinia#675 (comment)

For NuxtJS:

export default {
  build: {
    extend(config) {
      config.module.rules.push({
        test: /\.mjs$/,
        include: /node_modules/,
        type: 'javascript/auto',
      })
    },
  },
}

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