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

Fails to import module jbCGoMdf.js on init #97

Open
ShadowCrafter011 opened this issue May 3, 2024 · 0 comments
Open

Fails to import module jbCGoMdf.js on init #97

ShadowCrafter011 opened this issue May 3, 2024 · 0 comments

Comments

@ShadowCrafter011
Copy link

ShadowCrafter011 commented May 3, 2024

I want to integrate dice box with Ruby on Rails 7 so I pinned @3d-dice/dice-box using importmap bin/importmap pin @3d-dice/dice-box and moved the assets folders to public/dice-box/.

Using Stimulus I initialised dice box like this:

import { Controller } from "@hotwired/stimulus";
import DiceBox from "@3d-dice/dice-box";

// Connects to data-controller="norisknofun"
export default class extends Controller {
    async connect() {
        this.diceBox = new DiceBox("#dice", { assetPath: "/dice-box/" });
        await this.diceBox.init();
        // this.diceBox.roll("2d6");
    }
}

The new DiceBox expression works and it creates the canvas as expected in div#dice. However await this.diceBox.init() throws the following error: Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: https://domain.com/_/jbCGoMdf.js.

Now I'm at a loss of what to do as I couldn't find a file with that name anywhere. Neither in node_modules nor anywhere else in the project.

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