Skip to content

Module init fails in a typescript project #20

@laurentsenta

Description

@laurentsenta

Hi there, thanks for sharing & maintaining this library!

I try to use the library in a fresh create-react-app project with Typescript enabled. I get the following error:

secrets.js:456 Uncaught Error: Initialization failed.
    at Object.init (secrets.js:456)
    at secrets.js:828
    at Object.<anonymous> (secrets.js:29)
    at secrets.js:31
    at Object../node_modules/secrets.js-grempe/secrets.js (secrets.js:41)
    at __webpack_require__ (bootstrap:790)
    at fn (bootstrap:150)
    at Module../src/state/index.ts (index.ts:7)
    at __webpack_require__ (bootstrap:790)
    at fn (bootstrap:150)
    at Module../src/App.tsx ( groupOptions: {} namespace object:25)
    at __webpack_require__ (bootstrap:790)
    at fn (bootstrap:150)
    at Module../src/index.tsx (App.tsx:51)
    at __webpack_require__ (bootstrap:790)
    at fn (bootstrap:150)
    at Object.0 (variables.css?6ef5:37)
    at __webpack_require__ (bootstrap:790)
    at checkDeferredModules (bootstrap:45)
    at Array.webpackJsonpCallback [as push] (bootstrap:32)
    at main.chunk.js:1

I tried with:

import * as secrets from 'secrets.js-grempe';
import secrets from 'secrets.js-grempe';
const secrets = require('secrets.js-grempe');

and got the same error.

A global script balise works (<script src="/secrets.js"></script>).

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