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

typeError: t is not a constructor #85

Open
volodymyr-pictime opened this issue May 31, 2023 · 1 comment
Open

typeError: t is not a constructor #85

volodymyr-pictime opened this issue May 31, 2023 · 1 comment

Comments

@volodymyr-pictime
Copy link

volodymyr-pictime commented May 31, 2023

Hi.

I used @vue/cli-service version 4.5.9 and couldn't build project because this lib uses optional-chaining syntax.
Babel loader with "@babel/plugin-proposal-optional-chaining" helped me, but I don't need extra loaders so decided to update @vue/cli-service and @vue/cli-plugin-typescript to "^5.0.8" and now I have such runtime error

image

any thoughts?

@zofoklecja
Copy link

I encountered the same issue.

The root cause is conflicting module formats. The t in error message is a minified name of SortableJS module. By default sortablejs-vue3 is shipped as UMD which will be confused by ES structure of sortablejs, where constructor is available under default property
2023-07-19_16h00_34

I was able to fix it by manually specifying ES output in Webpack alias configuration:

resolve: {
  alias: {
    'sortablejs-vue3': 'sortablejs-vue3/dist/sortable-vue3.es',
    ...
  }
}

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

2 participants