generated from oddbird/polyfill-template
-
-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested
Description
I'm trying to install a css-anchor-positiong polyfill into my application and open it in safari.
I have this line in my application.js
if (!("anchorName" in document.documentElement.style)) {
const { default: polyfill } = await import('@oddbird/css-anchor-positioning/fn');
polyfill({
elements: undefined,
excludeInlineStyles: false,
useAnimationFrame: false,
});
}This error occurs. Any advice on how to properly address it?
InvalidMimeType: Error loading http://localhost:3000/vite-dev/entrypoints/application.css: expected content-type "text/css", got "text/javascript".
(anonymous function) β fetch.ts:39
o β @oddbird_css-anchor-positioning_fn.js:23
vite.config.mjs
import { defineConfig } from 'vite'
import ViteRails from 'vite-plugin-rails'
import path from 'path' // Import 'path' for path resolution
const env = process.env.RAILS_ENV || 'development'
export default defineConfig({
plugins: [
ViteRails({
fullReload: {
additionalPaths: [
'config/routes.rb',
'app/views/**/*',
'app/controllers/**/*',
'app/models/**/*'
]
}
})
],
define: {
'process.env.RAILS_ENV': JSON.stringify(env)
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'app/javascript')
}
}
})Browsers tested on
Safari Version 18.3.1 (20620.2.4.11.6)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested
