This repository was archived by the owner on Mar 21, 2023. It is now read-only.
fixed "SyntaxError: The requested module '/jquery/dist/jquery.js' does not provide an export named default" #61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
jquery.js module must have export default function, if it is need to import like this
import $ from 'jquery';
, but jquery does not have export default function.In this pull request I added other way to use jquery:
import * as Jquery from 'jquery';
, which load module to Jquery variable.Another way can be to use separated file (says, named jquery_compat.js), like this:
And in Select2.vue to use:
If it need I will fix my pull request with second way of bug solution.
Using
import * as Jquery from 'jquery';
is a bit ugly way in my opinion, because we cannot use jQuery.noConflict. But I don't know another way to fix this bug. If anyone knows a better fix than both above, please comment.