{"action":"created","issue":{"url":"https://api.github.com/repos/parcel-bundler/parcel/issues/808","repository_url":"https://api.github.com/repos/parcel-bundler/parcel","labels_url":"https://api.github.com/repos/parcel-bundler/parcel/issues/808/labels{/name}","comments_url":"https://api.github.com/repos/parcel-bundler/parcel/issues/808/comments","events_url":"https://api.github.com/repos/parcel-bundler/parcel/issues/808/events","html_url":"https://github.com/parcel-bundler/parcel/issues/808","id":297202291,"number":808,"title":"ECMAScript modules in browsers not working","user":{"login":"blogscot","id":6710435,"avatar_url":"https://avatars3.githubusercontent.com/u/6710435?v=4","gravatar_id":"","url":"https://api.github.com/users/blogscot","html_url":"https://github.com/blogscot","followers_url":"https://api.github.com/users/blogscot/followers","following_url":"https://api.github.com/users/blogscot/following{/other_user}","gists_url":"https://api.github.com/users/blogscot/gists{/gist_id}","starred_url":"https://api.github.com/users/blogscot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blogscot/subscriptions","organizations_url":"https://api.github.com/users/blogscot/orgs","repos_url":"https://api.github.com/users/blogscot/repos","events_url":"https://api.github.com/users/blogscot/events{/privacy}","received_events_url":"https://api.github.com/users/blogscot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-14T18:40:38Z","updated_at":"2018-02-14T18:48:03Z","closed_at":null,"author_association":"NONE","body":"🐛 bug report \r\n\r\nIn his blog post, [Joe Archibald](https://jakearchibald.com/2017/es-modules-in-browsers/) wrote the following example to demonstrate the use of ECMAScript modules in browsers. Unfortunately, this is broken when using `parcel-bundler@1.5.1` but works as expected using `serve@6.4.9`.\r\n\r\n```js\r\n<script type=\"module\">\r\n  import {addTextToBody} from './utils.js';\r\n\r\n  addTextToBody('Modules are pretty cool.');\r\n</script>\r\n```\r\n```js\r\n// utils.js\r\nexport function addTextToBody(text) {\r\n  const div = document.createElement('div');\r\n  div.textContent = text;\r\n  document.body.appendChild(div);\r\n}\r\n```\r\n\r\n<!--- Provide a general summary of the issue in the title above -->\r\n\r\n### 🎛 Configuration (.babelrc, package.json, cli command)\r\n\r\n.babelrc\r\n```js\r\n{\r\n  \"presets\": [\"env\", \"stage-3\"]\r\n}\r\n```\r\n\r\npackage.json\r\n```js\r\n{\r\n  \"name\": \"playground\",\r\n  \"version\": \"1.0.0\",\r\n  \"main\": \"index.js\",\r\n  \"license\": \"MIT\",\r\n  \"scripts\": {\r\n    \"start\": \"parcel index.html\"\r\n  },\r\n  \"dependencies\": {\r\n    \"babel-preset-env\": \"^1.6.1\",\r\n    \"babel-preset-stage-3\": \"^6.24.1\"\r\n  }\r\n}\r\n```\r\n\r\n### 🤔 Expected Behavior\r\n\r\nThe example should render the text, \"Modules are pretty cool.\"\r\n\r\n### 😯 Current Behavior\r\n\r\nFirefox reports the following error:\r\n\r\n```\r\nLoading failed for the <script> with source “http://localhost:1234/utils.js”.\r\n```\r\n\r\nChrome reports:\r\n\r\n```\r\nFailed to load module script: The server responded with a non-JavaScript MIME type of \"text/html\". Strict MIME type checking is enforced for module scripts per HTML spec.\r\n```\r\n\r\nSafari reports:\r\n\r\n```\r\nTypeError: 'text/html' is not a valid JavaScript MIME type.\r\n```\r\n\r\n### 💁 Possible Solution\r\n\r\nUnknown\r\n\r\n### 🔦 Context\r\n\r\nI am unaffected by this bug, as I have already found a work-around.\r\n\r\n### 💻 Code Sample\r\n\r\nExample code provided in initial bug report.\r\n\r\n### 🌍 Your Environment\r\n\r\n| Software         | Version(s) |\r\n| ---------------- | ---------- |\r\n| Parcel                 |   1.5.1\r\n| Node                  |   v9.3.0\r\n| npm/Yarn         |    yarn@1.3.2\r\n| Operating System | macOS 10.13.3\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/parcel-bundler/parcel/issues/comments/365706114","html_url":"https://github.com/parcel-bundler/parcel/issues/808#issuecomment-365706114","issue_url":"https://api.github.com/repos/parcel-bundler/parcel/issues/808","id":365706114,"user":{"login":"DeMoorJasper","id":2175521,"avatar_url":"https://avatars1.githubusercontent.com/u/2175521?v=4","gravatar_id":"","url":"https://api.github.com/users/DeMoorJasper","html_url":"https://github.com/DeMoorJasper","followers_url":"https://api.github.com/users/DeMoorJasper/followers","following_url":"https://api.github.com/users/DeMoorJasper/following{/other_user}","gists_url":"https://api.github.com/users/DeMoorJasper/gists{/gist_id}","starred_url":"https://api.github.com/users/DeMoorJasper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DeMoorJasper/subscriptions","organizations_url":"https://api.github.com/users/DeMoorJasper/orgs","repos_url":"https://api.github.com/users/DeMoorJasper/repos","events_url":"https://api.github.com/users/DeMoorJasper/events{/privacy}","received_events_url":"https://api.github.com/users/DeMoorJasper/received_events","type":"User","site_admin":false},"created_at":"2018-02-14T18:48:02Z","updated_at":"2018-02-14T18:48:02Z","author_association":"MEMBER","body":"inline javascript is currently not supported.\r\nRelated to #784"}}
{"actor":{"display_login":"DeMoorJasper"}}