Imports dont work

Hello,

i checked unpkg link and work so smth else is.
even claude opus didnt had a clue about whats going on.

because resource are not found script is not executing.

any help please.

Source map error: NetworkError when attempting to fetch resource.
Resource URL: moz-extension://4eb30316-e50c-41bd-bcd3-2ccf5ddd38a4/content-script/contentScript.js
Source Map URL: contentScript.js.map

import not found: HttpAgent
lockdown-install.js:1:97687
Source map error: NetworkError when attempting to fetch resource.
Resource URL: unpkg/@solana/web3.js@latest/lib/index.iife.js
Source Map URL: index.iife.js.map

What extension is this / what unpkg package are you trying to use?

hello,

Resource URL: unpkg/@solana/web3.js@latest/lib/index.iife.js

when i add this line on my app i have error output

import { Actor, HttpAgent } from ‘./node_modules/@dfinity/agent/lib/cjs/index.js’;

this is the main error

“SyntaxError: import not found: HttpAgent”

thnx a lot.

So, we don’t control the @solana/web3.js package, so I think that’s not related.

Are you using npm? If so, why are you importing all the way from the cjs index? What tooling are you using where you’re using both unpkg and node_modules in the same project? Are you following a particular guide?

Most of the time you should be fine with

import {Actor, HttpAgent} from '@dfinity/agent';

Im using npm.

to say the truth i’m using claude opus 3.

i test both this lines and no one works

import { Actor, HttpAgent } from ‘./node_modules/@dfinity/agent/lib/cjs/index.js’;
import { Actor, HttpAgent } from ‘@dfinity/agent’;

what is better to use unpkg or npm?

i’m trying to create a database on icp

thank you.

here is part of app.js

http paste debian net/1312105/

Ah okay - this is beyond my ability to debug for you. Best of luck

well is not chatgpt at least!
chatgpt is total scam…

anyway if possible you can tell me better to choose unpkg and to remove npm connections right??

thnx a lot!

I’m much more familiar with npm, but I’ve explicitly configured the unpkg link to point to the ESM build, so it’s particularly weird to have it use the CJS build.

I have no idea how this tool works, but I’d see if you can convince it to use npm and vite as a bundler

thank you!

i hope that this forum will have more attention in the future because on the first post a scammer answered to me…giving scam links and saying that your tech issues will solve if you insert 700$ on your solana account…