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

Module has no exported member #269

Closed
sunrabbit123 opened this issue Oct 26, 2022 · 1 comment
Closed

Module has no exported member #269

sunrabbit123 opened this issue Oct 26, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@sunrabbit123
Copy link
Contributor

Bug Report

I got the bug!

node : 16.15.0
typescript-json : 3.3.15

package.json

{
  "devDependencies": {
    "@types/aws-lambda": "^8.10.108",
    "serverless": "^3.23.0",
    "serverless-offline": "^11.1.3",
    "serverless-plugin-typescript": "^2.1.4",
    "ts-node": "^10.9.1",
    "ttypescript": "^1.5.13",
    "typescript": "^4.8.4"
  },
  "dependencies": {
    "typescript-json": "^3.3.15"
  },
  "scripts": {
    "start": "sls offline start"
  }
}

I changed it directly to ttsc and replaced dist files for serverless-plugin-typescript

tsconfig.json

{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es2017",
    "outDir": "dist",

    "noImplicitAny": true,
    "strictPropertyInitialization": true,
    "moduleResolution": "node",
    "sourceMap": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "strictNullChecks": true,
    "resolveJsonModule": true,
    "strict": true,
    "allowSyntheticDefaultImports": true,
    "typeRoots": ["@types", "node_modules/@types"],
    "plugins": [
      {
        "transform": "typescript-json/lib/transform"
        // "functional": true, // test function type
        // "numeric": true, // test `isNaN()` and `isFinite()`
      }
    ]
  },
  "include": ["handler.ts"],
  "exclude": ["dist", "node_modules"]
}

Code occuring the bug

"use strict";

import { APIGatewayEvent } from "aws-lambda";
import { stringify } from "typescript-json";

module.exports.hello = async (event: APIGatewayEvent) => {
  return {
    statusCode: 200,
    body: stringify({
      message: "Go Serverless v1.0! Your function executed successfully!",
      input: event,
    }),
  };
};

error

node_modules/typescript-json/lib/module.d.ts:8:10 - error TS2305: Module '"./functional/$string"' has no exported member '$string'.

8 import { $string } from "./functional/$string";
           ~~~~~~~

node_modules/typescript-json/lib/module.d.ts:9:10 - error TS2305: Module '"./functional/$tail"' has no exported member '$tail'.

9 import { $tail } from "./functional/$tail";
           ~~~~~

node_modules/typescript-json/lib/module.d.ts:547:45 - error TS2339: Property 'predicate' does not exist on type '<T>(input: T) => string'.

547     const predicate: typeof assertStringify.predicate;
                                                ~~~~~~~~~

node_modules/typescript-json/lib/module.d.ts:548:42 - error TS2339: Property 'throws' does not exist on type '<T>(input: T) => string'.

548     const throws: typeof assertStringify.throws;
                                             ~~~~~~


Found 4 errors in the same file, starting at: node_modules/typescript-json/lib/module.d.ts:8
@samchon samchon self-assigned this Oct 26, 2022
@samchon samchon added the bug Something isn't working label Oct 26, 2022
@sunrabbit123
Copy link
Contributor Author

additional information!

3.3.12 works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants