Skip to content

UglifyJs error using typescript, database ORM library. #426

@gitpushyj

Description

@gitpushyj

This is a (Bug Report / Feature Proposal)

  • What went wrong?
    When used with typeorm.js or squelize.js and deploy, ERROR in src/server.js from UglifyJs occured.

  • What did you expect should have happened?
    Successful deployment. Because when i tried to "ts-node src/server.ts", it's worked. and deleted code related to typeorm(or sequelize.js), it dosen't work.

  • What was the config you used?
    I used "serverless create --template aws-nodejs-typescript" and runtime environment is node 8,
    webpack.config.js

const path = require('path');
const slsw = require('serverless-webpack');

const entries = {};

Object.keys(slsw.lib.entries).forEach(
  (key) => (entries[key] = [ './source-map-install.js', slsw.lib.entries[key] ])
);

module.exports = {
  mode: slsw.lib.webpack.isLocal ? 'development' : 'production',
  entry: entries,
  devtool: 'source-map',
  resolve: {
    extensions: [ '.js', '.jsx', '.json', '.ts', '.tsx' ]
  },
  output: {
    libraryTarget: 'commonjs',
    path: path.join(__dirname, '.webpack'),
    filename: '[name].js'
  },
  target: 'node',
  module: {
    rules: [
      // all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
      { test: /\.tsx?$/, loader: 'ts-loader' }
    ]
  }
};

tsconfig.json

{
  "compilerOptions": {
    "sourceMap": true,
    "outDir": "./dist",
    "target": "es2015",
    "lib": [
      "esnext"
    ],
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "module": "commonjs"
  },
  "exclude": [
    "node_modules"
  ]
}
  • What stacktrace or error message from your provider did you see?
ERROR in src/server.js from UglifyJs
undefined

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