PlasmoHQ / docs

📘 Documentation site
https://docs.plasmo.com
12 stars 50 forks source link

Error occurs when "pnpm dev" after "pnpm create plasmo" according to the guide #41

Open sungjun001 opened 1 year ago

sungjun001 commented 1 year ago

$pnpm create plasmo

The installation went well with the above command.

After executing the below command, an error occurs.

$pnpm dev

file:///D:/work/exam-extention/exam-extention/node_modules/.pnpm/plasmo@0.65.0_biqbaboplfbrettd7655fr4n2y/node_modules/plasmo/dist/index.js:74 Visit https://docs.plasmo.com for documentation and more examples.)}});var qi={};Ie(qi,{default:()=>Pm});import{paramCase as gm}from"change-case";import{resolve as ym}from"path";import{cwd as wm}from"process";async function vm(){re();let t=U("--exp"),e=await Di(),r=wm(),n=ym(r,gm(e)||e);m("Project directory:",n);let o=je(n);if(m("Package name:",o.packageName),t&&!o.packageName.startsWith("with-"))throw new Error("Example extensions must have the with- prefix");await _n(n);let i=await Mt();m(Using package manager: ${i.name} ${i?.version}),await new Bt(o,i,t).create(),await Ti(n,i),await Ni(o,n),await ji(n,r,o,i)}var Pm,Wi=d(()=>{pe();V();b();Ct();xr();De();Ii();Oi();$i();Ai();Ri();Pm=vm});import{WebSocket as xm,WebSocketServer as Sm}from"ws";var Em,Bi,Ui=d(()=>{Em=JSON.stringify({type:"build_ready"}),Bi=async t=>{let e=new Sm({port:t+1});return{triggerReload:()=>{for(let n of e.clients)n.readyState===xm.OPEN&&n.send(Em)}}}});var He,Vt=d(()=>{Ae();He=()=>{let t=Pe(),{target:e,tag:r}=t,[n,o]=e.split("-");return{tag:r,target:e,browser:n,manifestVersion:o}}});import{AssertionError as bm}from"assert";function Je(t){throw new Error("Statement should be unreachable")}function Ur(t,e="Value is invalid"){if(!t)throw new bm({message:e});return t}var lt=d(()=>{});function Fm(t){switch(t){case 0:return"Web";case 1:case 2:case 3:return Gi[t];default:Je(t)}}var Hr,Jt,Jr,ft,_m,km,Vi,Cm,Mm,Lm,Vr,Gr,Ce,Me,X,Hi,Ji,Xd,Gi,Ht,Zd,eh,zi,Ki,th,le,ke,Im,rh,Dm,nh,oh,ih,sh,Yi=d(()=>{lt();Hr="en",Jt=!1,Jr=!1,ft=!1,_m=!1,km=!1,Vi=!1,Cm=!1,Mm=!1,Lm=!1,Gr=Hr,Me=typeof self=="object"?self:typeof global=="object"?global:{};typeof Me.vscode<"u"&&typeof Me.vscode.process<"u"?X=Me.vscode.process:typeof process<"u"&&(X=process);Hi=typeof X?.versions?.electron=="string",Ji=Hi&&X?.type==="renderer",Xd=Ji&&X?.sandboxed;typeof navigator=="object"&&!Ji?(Ce=navigator.userAgent,Jt=Ce.indexOf("Windows")>=0,Jr=Ce.indexOf("Macintosh")>=0,Mm=(Ce.indexOf("Macintosh")>=0||Ce.indexOf("iPad")>=0||Ce.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ft=Ce.indexOf("Linux")>=0,Vi=!0,Vr=navigator.language,Gr=Vr):typeof X=="object"?(Jt=X.platform==="win32",Jr=X.platform==="darwin",ft=X.platform==="linux",_m=ft&&!!X.env.SNAP&&!!X.env.SNAP_REVISION,Cm=Hi,Lm=!!X.env.CI||!!X.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Vr=Hr,Gr=Hr,km=!0):console.error("Unable to resolve platform.");Gi={[1]:"Mac",[2]:"Linux",[3]:"Windows"};Ht=0;Jr?Ht=1:Jt?Ht=3:ft&&(Ht=2);Zd=Object.values(Gi),eh=Fm(Ht),zi=Jt,Ki=ft,th=Vi&&typeof Me.importScripts=="function",le=Ce,ke=Gr;(n=>{function t(){return ke}n.value=t;function e(){return ke.length===2?ke==="en":ke.length>=3?ke[0]==="e"&&ke[1]==="n"&&ke[2]==="-":!1}n.isDefaultVariant=e;function r(){return ke==="en"}n.isDefault=r})(Im||={});rh=(()=>{if(typeof Me.postMessage=="function"&&!Me.importScripts){let t=[];Me.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n<o;n++){let i=t[n];if(i.id===r.data.vscodeScheduleAsyncWork){t.splice(n,1),i.callback();return}}});let e=0;return r=>{let n=++e;t.push({id:n,callback:r}),Me.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})(),Dm=!!(le&&le.indexOf("Chrome")>=0),nh=!!(le&&le.indexOf("Firefox")>=0),oh=!!(!Dm&&le&&le.indexOf("Safari")>=0),ih=!!(le&&le.indexOf("Edg/")>=0),sh=!!(le&&le.indexOf("Android")>=0)});var Qi,Xi=d(()=>{Yi();Qi=zi?"windows":Ki?"inotify":"fs-events"});async function ge(t,e){for(let r of t)if(await e(r))return r}var dt=d(()=>{});import{basename as Om,extname as Zi,posix as Nm,win32 as $m}from"path";var Z,es,Ge=d(()=>{Z=t=>t.replaceAll($m.sep,Nm.sep),es=t=>Zi(Om(t,Zi(t)))});import{relative as Tm,resolve as ts}from"path";var Gt,rs,ns=d(()=>{Gt=B(W(),1);b();Ge();rs=async({indexFilePath:t="",withMessaging:e=!1,withMainWorldScript:r=!1},n)=>{m("Creating BGSW entry");let o=ts(n.commonPath.staticDirectory,"background"),i=ts(o,"index.ts"),s=Tm(o,t),a=[e&&'import "./messaging"',t&&import "${Z(s).slice(0,-3)}",r&&'import "./main-world-scripts"'].filter(Boolean).join(`

SyntaxError: missing ) after argument list at Loader.moduleStrategy (internal/modules/esm/translators.js:149:18) `

louisgv commented 1 year ago

Hey there, what version of pnpm and nodejs are you using?

Snorlaxx-plot commented 1 year ago

same error, any update?

louisgv commented 1 year ago

@Snorlaxx-plot which pnpm and nodejs version are you using?

Snorlaxx-plot commented 1 year ago

node 14.19.3 pnpm 7.29.3

Snorlaxx-plot commented 1 year ago

I change node version to 16, it works~