Skip to content

Commit ecef98a

Browse files
stefan-burkeclaude
andauthored
Fix webauthn_utils MIME type error by adding importmap pin (#458)
The webauthn_utils module was not pinned in the importmap, so the browser tried to fetch it as a regular HTTP request which returned HTML instead of JavaScript. Pin it and change the imports from relative paths to the pinned module name. https://claude.ai/code/session_017U5qBWgHBppLwz5kp9Vbhp Co-authored-by: Claude <noreply@anthropic.com>
1 parent 90ff53a commit ecef98a

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

app/javascript/passkey_login.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
base64ToArrayBuffer,
44
arrayBufferToBase64,
55
postJson,
6-
} from "./webauthn_utils";
6+
} from "webauthn_utils";
77

88
document.addEventListener("turbo:load", () => {
99
const loginButtons = document.querySelectorAll(

app/javascript/passkey_registration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
base64ToArrayBuffer,
44
arrayBufferToBase64,
55
postJson,
6-
} from "./webauthn_utils";
6+
} from "webauthn_utils";
77

88
window.registerPasskey = async function () {
99
const nickname = prompt("Enter a nickname for this passkey:");

config/importmap.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
pin "guides_slider"
1515
pin "search"
1616
pin "image_resize"
17+
pin "webauthn_utils"
1718
pin "passkey_registration"
1819
pin "passkey_login"
1920
pin "text_replacement_form"

0 commit comments

Comments
 (0)