clarketm / saga-monitor

Simple, elegant, and configurable redux-saga monitor
MIT License
37 stars 8 forks source link

import createSagaMonitor from "@clarketm/saga-monitor" not found #2

Open ghost opened 5 years ago

ghost commented 5 years ago

Describe the bug When using import createSagaMonitor from "@clarketm/saga-monitor" for some reasons at runtime the saga-monitor.js is not resolved what results in a "not found" error.

To fix the error I have to: import createSagaMonitor from "@clarketm/saga-monitor/dist/saga-monitor.js";

Am I doing something wrong or is that a real issue, could you please advice ?

{
    "compilerOptions": {
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "target": "es2015",
        "module": "es2015",
        "moduleResolution":"Node",
        "jsx": "react-native",
        "outDir": "artifacts",
        "rootDir": "src",
        "allowSyntheticDefaultImports": true,
        "noImplicitAny": false,
        "preserveConstEnums": true,
        //"allowJs": false,
        "sourceMap": true,
        "noImplicitReturns": true,
        "noUnusedParameters": true,
        "noUnusedLocals": true,
    },
    "types": [
        "react",
        "react-native",
        "jest"
    ],
    "exclude": [
        "android",
        "App.js",
        "ios",
        "build",
        "node_modules"
    ],
    "compileOnSave": false
}
 "dependencies": {
    "@clarketm/saga-monitor": "^1.0.8",
    "@types/react": "^16.7.18",
    "native-base": "^2.8.0",
    "react": "^16.7.0",
    "react-art": "^16.7.0",
    "react-dom": "^16.7.0",
    "react-native": "0.57.8",
    "react-native-web": "^0.9.13",
    "react-redux": "^6.0.0",
    "redux": "^4.0.1",
    "redux-logger": "^3.0.6",
    "redux-saga": "^0.16.2"
  },
  "devDependencies": {
    "@babel/core": "^7.2.2",
    "@babel/plugin-proposal-class-properties": "^7.2.3",
    "@babel/preset-env": "^7.2.3",
    "@babel/preset-react": "^7.0.0",
    "babel-jest": "23.6.0",
    "babel-loader": "^8.0.4",
    "babel-plugin-react-native-web": "^0.9.13",
    "jest": "23.6.0",
    "metro-react-native-babel-preset": "0.51.1",
    "react-test-renderer": "16.6.3",
    "tslint": "^5.12.0",
    "typescript": "^3.2.2",
    "webpack": "^4.28.3",
    "webpack-cli": "^3.1.2",
    "webpack-dev-server": "^3.1.14"
  },
clarketm commented 5 years ago

@ArThoX - this is most likely an issue with your TypeScript configuration or transpilation. Unfortunately, I am not well-versed in TypeScript, or tsconfig options for that matter, so I will need to delve into that before I can propose a solution.

Does it still fail if you make the following change?

- "moduleResolution":"Node",
+ "moduleResolution":"Classic",
ghost commented 5 years ago

@clarketm The error persists.

However, I think this is simply due to the fact that your package.json does not defines d.ts typings. Nothing to worry about (if you don't support typescript).

clarketm commented 5 years ago

@ArThoX - I did not intend to not support TypeScript imports. I would like to add typing to this project if it adds benefit, which it sounds like it does. If this is something you have expertise in, then I would greatly appreciate a PR; otherwise, I can work on getting this added once I get time can brush-up on the syntax.