{"action":"created","issue":{"url":"https://api.github.com/repos/TypeStrong/ts-loader/issues/867","repository_url":"https://api.github.com/repos/TypeStrong/ts-loader","labels_url":"https://api.github.com/repos/TypeStrong/ts-loader/issues/867/labels{/name}","comments_url":"https://api.github.com/repos/TypeStrong/ts-loader/issues/867/comments","events_url":"https://api.github.com/repos/TypeStrong/ts-loader/issues/867/events","html_url":"https://github.com/TypeStrong/ts-loader/issues/867","id":379373574,"node_id":"MDU6SXNzdWUzNzkzNzM1NzQ=","number":867,"title":"\"Module parse failed: Unexpected token\" when added the class field","user":{"login":"TokugawaTakesi","id":41653501,"node_id":"MDQ6VXNlcjQxNjUzNTAx","avatar_url":"https://avatars3.githubusercontent.com/u/41653501?v=4","gravatar_id":"","url":"https://api.github.com/users/TokugawaTakesi","html_url":"https://github.com/TokugawaTakesi","followers_url":"https://api.github.com/users/TokugawaTakesi/followers","following_url":"https://api.github.com/users/TokugawaTakesi/following{/other_user}","gists_url":"https://api.github.com/users/TokugawaTakesi/gists{/gist_id}","starred_url":"https://api.github.com/users/TokugawaTakesi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TokugawaTakesi/subscriptions","organizations_url":"https://api.github.com/users/TokugawaTakesi/orgs","repos_url":"https://api.github.com/users/TokugawaTakesi/repos","events_url":"https://api.github.com/users/TokugawaTakesi/events{/privacy}","received_events_url":"https://api.github.com/users/TokugawaTakesi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-10T01:14:18Z","updated_at":"2018-11-15T07:07:24Z","closed_at":"2018-11-15T07:07:24Z","author_association":"NONE","body":"Works: \r\n\r\n```\r\nexport default class ConfigRepresentative {\r\n  constructor() {\r\n    console.log('ok');\r\n  }\r\n}\r\n```\r\n\r\nFails (same if to remove `private` and `static`): \r\n\r\n```\r\nexport default class ConfigRepresentative {\r\n\r\n  private static ownInstanceHasBeenCreated: boolean = false;\r\n\r\n  constructor() {\r\n    console.log('ok');\r\n  }\r\n}\r\n```\r\n\r\nError:\r\n\r\n```\r\nERROR in ./TypeScriptSource/index.ts 7:10\r\nModule parse failed: Unexpected token (7:10)\r\nYou may need an appropriate loader to handle this file type.\r\n| export default class ConfigRepresentative {\r\n| \r\n>   private static ownInstanceHasBeenCreated: boolean = false;\r\n| \r\n|   constructor() {\r\n\r\n```\r\n\r\nwebpack.config.js\r\n\r\n```\r\nmodule.exports = {\r\n\r\n  entry: './TypeScriptSource/index.ts',\r\n  output: {\r\n    filename: 'index.js',\r\n    path: __dirname,\r\n    libraryTarget: 'umd'\r\n  },\r\n\r\n  target: 'node',\r\n  mode: 'production',\r\n  watch: true,\r\n\r\n  module: {\r\n    rules: [\r\n      {\r\n        test: /\\.ts?$/,\r\n        use: 'ts-loader',\r\n        exclude: /node_modules/\r\n      }\r\n    ]\r\n  },\r\n  resolve: {\r\n    extensions: ['.ts', '.js']\r\n  }\r\n};\r\n```\r\n\r\nFor saving your time on reproducing this problem, I attached the souse files.\r\n[error.zip](https://github.com/TypeStrong/ts-loader/files/2567961/error.zip)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/TypeStrong/ts-loader/issues/comments/438939782","html_url":"https://github.com/TypeStrong/ts-loader/issues/867#issuecomment-438939782","issue_url":"https://api.github.com/repos/TypeStrong/ts-loader/issues/867","id":438939782,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODkzOTc4Mg==","user":{"login":"TokugawaTakesi","id":41653501,"node_id":"MDQ6VXNlcjQxNjUzNTAx","avatar_url":"https://avatars3.githubusercontent.com/u/41653501?v=4","gravatar_id":"","url":"https://api.github.com/users/TokugawaTakesi","html_url":"https://github.com/TokugawaTakesi","followers_url":"https://api.github.com/users/TokugawaTakesi/followers","following_url":"https://api.github.com/users/TokugawaTakesi/following{/other_user}","gists_url":"https://api.github.com/users/TokugawaTakesi/gists{/gist_id}","starred_url":"https://api.github.com/users/TokugawaTakesi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TokugawaTakesi/subscriptions","organizations_url":"https://api.github.com/users/TokugawaTakesi/orgs","repos_url":"https://api.github.com/users/TokugawaTakesi/repos","events_url":"https://api.github.com/users/TokugawaTakesi/events{/privacy}","received_events_url":"https://api.github.com/users/TokugawaTakesi/received_events","type":"User","site_admin":false},"created_at":"2018-11-15T07:07:24Z","updated_at":"2018-11-15T07:07:24Z","author_association":"NONE","body":"Found the reason.\r\n[“Module parse failed: Unexpected token” when added the class field.](https://stackoverflow.com/questions/53313863/module-parse-failed-unexpected-token-when-added-the-class-field/53314090#53314090)"}}
{"actor":{"display_login":"TokugawaTakesi"}}