Modules don't work in extensions |
||||||
Issue description
What steps will reproduce the problem?
1. Load an extension with the content below.
What is the expected result?
The extension should load without error (and should have access to the module).
What happens instead of that?
The module fails to load and gives the error:
"Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec."
--- Extension ---
// manifest.json
{
"name": "foo",
"description": "bar",
"version": "0.1",
"background": {"page": "background.html"}
"manifest_version": 2
}
// background.html
<!doctype html>
<html>
<script src="background.js" type="module"></script>
</html>
// background.js
import {log} from '/module.js'
log('hi');
// module.js
export function log(data) { console.log(data); }
,
Sep 28 2017
cc: hiroshige I think we only need to special case file URLs then.
,
Nov 10 2017
,
Nov 15 2017
Test failed on 64.0.3268.0 (Official Build) canary (64-bit) (cohort: Clang-64)
,
Nov 22 2017
Can reproduce this issue on chrome 64.0.3275.0 (Official Build) canary (64-bit) (cohort: Clang-64). Why this issue status is fixed?
,
Nov 23 2017
Firefox has the same (or a very similar) bug. If you want script modules to also work in Firefox extensions, you can vote here: https://bugzilla.mozilla.org/show_bug.cgi?id=1404727
,
Dec 22 2017
This bug seems to be a duplicate of https://bugs.chromium.org/p/chromium/issues/detail?id=769012
,
Dec 22 2017
#c7 did you mean to link to a different issue?
,
Dec 22 2017
#c8 yes, thanks for pointing out! this is the issue I wanted to refer to: https://bugs.chromium.org/p/chromium/issues/detail?id=763673
,
Dec 22 2017
Re #5: The fix for this issue landed in 63.0.3227.0. If you can still reproduce this issue, please provide a test case.
,
Dec 22 2017
,
Dec 27 2017
Re #10: there is an old issue https://bugs.chromium.org/p/chromium/issues/detail?id=762483#c18 (#c18 find out the reason and give a way to resovle this problem, but this issue mark as won't fix. and now this issue has a wide impact on modules/local-files, consider to deal this suitable, not ignore)
,
Dec 27 2017
Recent discussions: https://bugs.chromium.org/p/chromium/issues/detail?id=728377#c23 ~ #c30 (there is no following)
,
Dec 27 2017
,
Dec 27 2017
Thanks for heads up. Filed a new Issue 797712 for tracking the particular issue caused by the local registry key. (Leaving this issue closed as fixed, because the basic module script+extention issue has been fixed.)
,
May 4 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/17d521bb5afbcc8d6ee95b46a4565351aee6d4fd commit 17d521bb5afbcc8d6ee95b46a4565351aee6d4fd Author: Istiaque Ahmed <lazyboy@chromium.org> Date: Fri May 04 19:44:07 2018 Extensions: Add a test for importing modules from web Bug: 769012 Change-Id: Iae7e7ff1b338c2302476002c28dcc58378292404 Reviewed-on: https://chromium-review.googlesource.com/1028617 Commit-Queue: Istiaque Ahmed <lazyboy@chromium.org> Reviewed-by: Devlin <rdevlin.cronin@chromium.org> Cr-Commit-Position: refs/heads/master@{#556156} [modify] https://crrev.com/17d521bb5afbcc8d6ee95b46a4565351aee6d4fd/chrome/browser/extensions/extension_modules_apitest.cc [add] https://crrev.com/17d521bb5afbcc8d6ee95b46a4565351aee6d4fd/chrome/test/data/extensions/api_test/module_from_web/hello_module.js
,
Jun 27 2018
Issue 728377 has been merged into this issue. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by bugdroid1@chromium.org
, Sep 28 2017