Skip to content

TypeError: Failed to resolve module specifier '@popperjs/core' #2698

Closed Answered by Ninita1
Ninita1 asked this question in Q&A
Discussion options

You must be logged in to vote

I still don't know if we really need to specify the import of the Popper plugin.
However, for my CanJS project, seems I solved the problem importing Popper normally and adding it to the window before initializing the tempus-dominus picker:

import * as Popper from '@popperjs/core';
import * as tempusDominus from '@eonasdan/tempus-dominus';

window.Popper = Popper;
this.dateTimePicker = new tempusDominus.TempusDominus(dateTimePickerElem, {
      localization: {
        locale: this.getUserLanguage(),
        format: this.dateFormat
      },
      restrictions: {
        minDate: this.minDate,
        maxDate: this.maxDate
      }
    });

If anyone has a better solution, please share.

Even …

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@Ninita1
Comment options

@Eonasdan
Comment options

Comment options

You must be logged in to vote
3 replies
@Eonasdan
Comment options

@Ninita1
Comment options

@Eonasdan
Comment options

Answer selected by Ninita1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants