Skip to content

Webpack: error for missing modules in WASM version #141

@daFish

Description

@daFish

What is the issue about?

  • Bug
  • Feature request
  • Usage question
  • Documentation
  • Contributing / Development

What part(s) of Essentia.js is involved?

  • essentia.js-core (vanilla algorithms)
  • essentia.js-model (machine learning algorithms)
  • essentia.js-plot (plotting utility module)
  • essentia.js-extractor (typical algorithm combinations utility)

Description

I'm using webpack to bundle my scripts and I get the following warning/errors:

Module build failed: Module not found:
"./node_modules/essentia.js/dist/essentia-wasm.es.js" contains a reference to the file "crypto".
This file can not be found, please check it for typos or update it if the file got moved.

 ERROR  Failed to compile with 2 errors                                                                                                                                                                                            12:06:27

Module build failed: Module not found:
"./node_modules/essentia.js/dist/essentia-wasm.es.js" contains a reference to the file "path".
This file can not be found, please check it for typos or update it if the file got moved.

"./node_modules/essentia.js/dist/essentia-wasm.es.js" contains a reference to the file "fs".
This file can not be found, please check it for typos or update it if the file got moved.

Is there anything I can do to prevent such an error? Note: The script is working however.

Steps to reproduce / Code snippets / Screenshots

Small sample script:

import Essentia from 'essentia.js/dist/essentia.js-core.es';
import { EssentiaWASM } from 'essentia.js/dist/essentia-wasm.es.js';

export default class EssentiaProcessor {
    essentia: Essentia;

    constructor() {
        this.essentia = new Essentia(EssentiaWASM, process.env.NODE_ENV === 'development');
    }
}

System info

  • essentia.js-Version: 0.1.3
  • Webpack: 5.74.0
  • NodeJS: v21.7.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions