{"action":"opened","issue":{"url":"https://api.github.com/repos/vuejs/vue-cli/issues/2171","repository_url":"https://api.github.com/repos/vuejs/vue-cli","labels_url":"https://api.github.com/repos/vuejs/vue-cli/issues/2171/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/vue-cli/issues/2171/comments","events_url":"https://api.github.com/repos/vuejs/vue-cli/issues/2171/events","html_url":"https://github.com/vuejs/vue-cli/issues/2171","id":349842499,"node_id":"MDU6SXNzdWUzNDk4NDI0OTk=","number":2171,"title":"ts-loader throwing an error when attempting to build with transpileOnly and happyPackMode set to false","user":{"login":"ol-ko","id":1898272,"node_id":"MDQ6VXNlcjE4OTgyNzI=","avatar_url":"https://avatars0.githubusercontent.com/u/1898272?v=4","gravatar_id":"","url":"https://api.github.com/users/ol-ko","html_url":"https://github.com/ol-ko","followers_url":"https://api.github.com/users/ol-ko/followers","following_url":"https://api.github.com/users/ol-ko/following{/other_user}","gists_url":"https://api.github.com/users/ol-ko/gists{/gist_id}","starred_url":"https://api.github.com/users/ol-ko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ol-ko/subscriptions","organizations_url":"https://api.github.com/users/ol-ko/orgs","repos_url":"https://api.github.com/users/ol-ko/repos","events_url":"https://api.github.com/users/ol-ko/events{/privacy}","received_events_url":"https://api.github.com/users/ol-ko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-12T20:44:10Z","updated_at":"2018-08-12T20:44:10Z","closed_at":null,"author_association":"NONE","body":"### Version\r\n3.0.0\r\n\r\n### Node and OS info\r\nnode 10.8.0, npm 6.2.0, macOS HighSierra 10.13.6\r\n\r\n### Steps to reproduce\r\n- check out the repository https://github.com/ol-ko/vue-cli-ts-loader-error\r\n- npm install\r\n- npm run build\r\n\r\n### What is expected?\r\nI'm trying to build a TypeScript project using vue-cli with a `--target lib` setting.\r\n\r\nAs I need typings along with the bundle files, I've tried to make vue.config.js set `transpileOnly` and `happyPackMode` options of `ts-loader` to false by doing the following:\r\n\r\n```\r\nmodule.exports = {\r\n    chainWebpack: config => {\r\n        config.module\r\n            .rule('ts')\r\n            .use('ts-loader')\r\n            .loader('ts-loader')\r\n            .tap(opts => {\r\n                opts.transpileOnly = false;\r\n                opts.happyPackMode = false;\r\n                return opts;\r\n            });\r\n    }\r\n};\r\n```\r\n\r\n### What is actually happening?\r\nUnfortunately, building with this configuration results in an error thrown by `ts-loader`:\r\n\r\n```\r\nModule build failed (from ./node_modules/thread-loader/dist/cjs.js):\r\nThread Loader (Worker 2)\r\nCannot read property 'options' of undefined\r\n\r\n    at Object.makeServicesHost (/Users/olga/code/homegate-ui/ui/node_modules/ts-loader/dist/servicesHost.js:18:66)\r\n    at successfulTypeScriptInstance (/Users/olga/code/homegate-ui/ui/node_modules/ts-loader/dist/instances.js:164:45)\r\n    at Object.getTypeScriptInstance (/Users/olga/code/homegate-ui/ui/node_modules/ts-loader/dist/instances.js:51:12)\r\n    at Object.loader (/Users/olga/code/homegate-ui/ui/node_modules/ts-loader/dist/index.js:16:41)\r\n\r\n @ ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js 2:0-22 2:0-22\r\n```\r\n\r\n---\r\nFull source code of the project can be found here: https://github.com/ol-ko/vue-cli-ts-loader-error\r\n\r\nCreating an issue here, as same versions of ts-loader (4.4.2) and webpack (4.16.5) seem to work fine in isolation from vue-cli.\r\n\r\nThanks!\r\n\r\n<!-- generated by vue-issues. DO NOT REMOVE -->"}}
{"actor":{"display_login":"ol-ko"}}