Skip to content

The requested module 'stimulus-flatpickr' does not provide an export named 'default'Β #116

@cwills

Description

@cwills

I recently started receiving this error after migrating from Rails 6 to Rails 7. It worked fine for about a week and then started throwing this error. It still works fine on my production server.

Package.json

{
  "dependencies": {
    "@babel/core": "^7.0.0",
    "@babel/plugin-proposal-private-methods": "^7.18.6",
    "@rails/actiontext": "^8.0.0",
    "@rails/webpacker": "5.4.4",
    "browser-image-compression": "^2.0.2",
    "flatpickr": "^4.6.13",
    "stimulus-flatpickr": "^1.4.0",
    "trix": "^2.1.8",
    "webpack": "^4.46.0",
    "webpack-cli": "^3.3.12"
  },
  "devDependencies": {
    "webpack-dev-server": "^3"
  }
}

application.js

import { Application } from "@hotwired/stimulus"

const application = Application.start()

// Configure Stimulus development experience
application.debug = false
window.Stimulus   = application

export { application }

// import Flatpickr
import Flatpickr from 'stimulus-flatpickr'

// Manually register Flatpickr as a stimulus controller
application.register('flatpickr', Flatpickr)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions