I am trying to add the web3 script to my page(https://web3js.readthedocs.io/en/v1.10.0/getting-started.html), but in no way does it work.
To add it in VS code so i get the intellisens that’s basically the only code that works
import Web3 from 'web3';
the problem is that if i use it, i get a bunch of errors in the console….
“TypeError: The specifier “web3” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “../” or “/”.”
I get as well this thing
ReferenceError: require is not defined
web3.ts:18
lockdown-install.js:1:97687
import Web3 from './node_modules/web3/src/index.js'
If i specify the path manually then i get
Script from “http://127.0.0.1:5500/node_modules/web3/lib/commonjs/web3.d.ts” was blocked because of a disallowed MIME type (“video/mp2t”). Index.html
If i try to use type=text/javascript or typescript, then i get the error that import definition must be defined at the top of the page.. ????♂️????♂️????♂️????♂️????♂️????♂️????♂️
All the solutions i found at best fix 1 problem, but then the new one appears so at the end nothing got fixed, i am using vs code, and to run the server i use Live server plugin, i did install all the npm required modules, but it fixed NOTHING, what to do then?