HTML canvas game giving error cant import outside of a module

The file that isn’t working is a js file and I’m trying to import a resource.js file to get the game objects loaded

SyntaxError: Cannot use import statement outside a module

If I remove that js import the same error pops up for my CSS stylesheet saying the same thing.
I’m on node 20.16.0 and I’m running the files in google chrome, but the error is happening even if I switch browsers.

I have looked through some forums and have made myself a live server which fixed my export problem I was having before this, but it didn’t help with the import statement. The import statement I’m using is:

import {Resources} from "./src/resources.js"
import './src/style.css'

I have the CSS linked with this in the area

<link rel="stylesheet" href="src/style.css"></link>

and I have the 2 js files linked with this:

<script src="src/resources.js" type="module"></script>
<script src="main.js"></script>

I’ve tried to flip the way I called the scripts in the html, I’ve tried calling both of them as modules or switching which of them was called as a module which resulted in an error saying it couldn’t fetch the files.