{"action":"created","issue":{"url":"https://api.github.com/repos/deepsweet/istanbul-instrumenter-loader/issues/33","repository_url":"https://api.github.com/repos/deepsweet/istanbul-instrumenter-loader","labels_url":"https://api.github.com/repos/deepsweet/istanbul-instrumenter-loader/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/deepsweet/istanbul-instrumenter-loader/issues/33/comments","events_url":"https://api.github.com/repos/deepsweet/istanbul-instrumenter-loader/issues/33/events","html_url":"https://github.com/deepsweet/istanbul-instrumenter-loader/issues/33","id":177585387,"number":33,"title":"SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' (1:0)","user":{"login":"kevincaradant","id":6093175,"avatar_url":"https://avatars.githubusercontent.com/u/6093175?v=3","gravatar_id":"","url":"https://api.github.com/users/kevincaradant","html_url":"https://github.com/kevincaradant","followers_url":"https://api.github.com/users/kevincaradant/followers","following_url":"https://api.github.com/users/kevincaradant/following{/other_user}","gists_url":"https://api.github.com/users/kevincaradant/gists{/gist_id}","starred_url":"https://api.github.com/users/kevincaradant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevincaradant/subscriptions","organizations_url":"https://api.github.com/users/kevincaradant/orgs","repos_url":"https://api.github.com/users/kevincaradant/repos","events_url":"https://api.github.com/users/kevincaradant/events{/privacy}","received_events_url":"https://api.github.com/users/kevincaradant/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":20,"created_at":"2016-09-17T15:37:09Z","updated_at":"2016-09-19T23:18:26Z","closed_at":null,"body":"Hi\r\n\r\nI want to coverage all files and not only the tests. So I excluded the node_moduels folder. But i get this error on all the others files.\r\n\r\nWARNING in ./lib/components/home/home.config.js\r\nModule build failed: SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' (1:0)\r\n    at Parser.pp.raise (C:\\Users\\kevin\\Documents\\Projets\\web-template-webpack\\node_modules\\babylon\\lib\\parser\\location.js:22:13)\r\n\r\nThis is my karma.config.js:\r\n\r\n```\r\nvar webpack = require(\"webpack\");\r\nvar path = require(\"path\");\r\nmodule.exports = function(config) {\r\n\tconfig.set({\r\n\t\tfiles: [\r\n\t\t\t'./tests.webpack.js'\r\n\t\t],\r\n\r\n\t\tpreprocessors: { './tests.webpack.js': ['webpack'] },\r\n\r\n\t\t// frameworks to use\r\n\t\tframeworks: ['chai', 'mocha'],\r\n\r\n\t\treporters: ['spec', 'coverage'],\r\n\r\n\t\tcoverageReporter: {\r\n\t\t\ttype: 'html',\r\n\t\t\tdir: 'coverage/'\r\n\t\t},\r\n\r\n\t\twebpack: {\r\n\t\t\t// webpack configuration\r\n\t\t\tmodule: {\r\n\t\t\t\tloaders: [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttest: /\\.js$/,\r\n\t\t\t\t\t\texclude: [\r\n\t\t\t\t\t\t\tpath.resolve('lib/'),\r\n\t\t\t\t\t\t\tpath.resolve('node_modules/')\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t\tloaders: ['babel']\r\n\t\t\t\t\t}\r\n\t\t\t\t],\r\n\r\n\t\t\t\tpostLoaders: [{\r\n\t\t\t\t\ttest: /\\.js/,\r\n\t\t\t\t\tinclude: path.resolve('lib/'),\r\n\t\t\t\t\texclude: /(node_modules)/,\r\n\t\t\t\t\tloader: 'istanbul-instrumenter'\r\n\t\t\t\t}]\r\n\t\t\t},\r\n\t\t\tresolve: {\r\n\t\t\t\tmodulesDirectories: [\r\n\t\t\t\t\t\"\",\r\n\t\t\t\t\t\"lib\",\r\n\t\t\t\t\t\"node_modules\"\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\twebpackMiddleware: {\r\n\t\t\t// webpack-dev-middleware configuration\r\n\t\t\tnoInfo: true\r\n\t\t},\r\n\r\n\t\tplugins: [\r\n\t\t\trequire(\"karma-webpack\"),\r\n\t\t\trequire(\"istanbul-instrumenter-loader\"),\r\n\t\t\trequire(\"karma-mocha\"),\r\n\t\t\trequire(\"karma-coverage\"),\r\n\t\t\trequire(\"karma-phantomjs-launcher\"),\r\n\t\t\trequire(\"karma-spec-reporter\"),\r\n\t\t\trequire(\"karma-chai-plugins\"),\r\n\t\t\trequire(\"karma-sourcemap-loader\")\r\n\t\t],\r\n\r\n\t\tbrowsers: ['PhantomJS']\r\n\t});\r\n};\r\n\r\n```\r\n\r\nthis is my tests.webpack.js:\r\n```\r\n// require all `project/test/src/components/**/index.js`\r\nconst testsContext = require.context('./lib/', true, /*.js$/);\r\n\r\ntestsContext.keys().forEach(testsContext);\r\n```\r\n\r\nExample of home.config.js:\r\n\r\n```\r\nimport Home from './home.html';\r\nimport RightMenu from '../rightMenu/rightMenu.html';\r\n\r\nclass HomeConfig {\r\n\tstatic initRoute($stateProvider) {\r\n\t\t'ngInject';\r\n\t\t$stateProvider.state('home', {\r\n\t\t\turl: '/home',\r\n\t\t\tviews: {\r\n\t\t\t\tmainView: {\r\n\t\t\t\t\ttemplateUrl: Home,\r\n\t\t\t\t\tcontroller: 'homeController as home'\r\n\t\t\t\t},\r\n\t\t\t\trightMenuView: {\r\n\t\t\t\t\ttemplateUrl: RightMenu,\r\n\t\t\t\t\tcontroller: 'rightMenuController'\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default HomeConfig.initRoute;\r\n```\r\n\r\nWhat's wrong ? Thank you :)\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/deepsweet/istanbul-instrumenter-loader/issues/comments/248156980","html_url":"https://github.com/deepsweet/istanbul-instrumenter-loader/issues/33#issuecomment-248156980","issue_url":"https://api.github.com/repos/deepsweet/istanbul-instrumenter-loader/issues/33","id":248156980,"user":{"login":"deepsweet","id":266822,"avatar_url":"https://avatars.githubusercontent.com/u/266822?v=3","gravatar_id":"","url":"https://api.github.com/users/deepsweet","html_url":"https://github.com/deepsweet","followers_url":"https://api.github.com/users/deepsweet/followers","following_url":"https://api.github.com/users/deepsweet/following{/other_user}","gists_url":"https://api.github.com/users/deepsweet/gists{/gist_id}","starred_url":"https://api.github.com/users/deepsweet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deepsweet/subscriptions","organizations_url":"https://api.github.com/users/deepsweet/orgs","repos_url":"https://api.github.com/users/deepsweet/repos","events_url":"https://api.github.com/users/deepsweet/events{/privacy}","received_events_url":"https://api.github.com/users/deepsweet/received_events","type":"User","site_admin":false},"created_at":"2016-09-19T23:18:26Z","updated_at":"2016-09-19T23:18:26Z","body":"ok, after deep digging into the problem and fixing my [start-istanbul](https://github.com/start-runner/istanbul) (look at these \"hacky\" singletons to share `sourceMapStore` accross different istanbul steps) to remap coverage to original source if it was transpiled, now I can totally understand what's going on here.\r\n\r\n@DatenMetzgerX your solution proposed in https://github.com/istanbuljs/istanbul-lib-instrument/pull/23 + https://github.com/istanbuljs/istanbul-lib-source-maps/pull/4 looks legit, in my opinion coverage object is ok to store the original source map in it. I didn't look in detail in https://github.com/karma-runner/karma-coverage/pull/251 yet, just hope that your PR will contain remapping of coverage map.\r\n\r\n@kevincaradant sorry for involving you in this :)\r\n\r\n**the bottom line**: we are waiting for at least 3 PRs to be merged to just be able to show you coverage over original sources."}}
{"actor":{"display_login":"deepsweet"}}