Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot access 'default' before initialization #1032

Closed
hellsan631 opened this issue Aug 8, 2022 · 4 comments · Fixed by #2312
Closed

Cannot access 'default' before initialization #1032

hellsan631 opened this issue Aug 8, 2022 · 4 comments · Fixed by #2312
Labels
bug Something isn't working needs repro Needs an example to reproduce

Comments

@hellsan631
Copy link

hellsan631 commented Aug 8, 2022

Version

0.1.7

Platform

macOS 12.5.0 (Apple Silicon)

What steps will reproduce the bug?

  1. bun create react my-app
  2. bun a @nextui-org/react
  3. Add import from package import { NextUIProvider } from '@nextui-org/react' to index
  4. Run bun dev and observe error.

How often does it reproduce? Is there a required condition?

100% of the time that NextUIProvider is imported. Running this is a node environment works.

What is the expected behavior?

Package import works as expected without error

What do you see instead?

Cannot access 'default' before initialization
In lr – node_modules.bun:7:7023

`+d.line_text.trim()),a=a.trimRight()+`
 `+u,o(a.trim())}console.groupEnd()}verbose=!1;handleError=t=>{O.error("Websocket error",t.error),this.reconnect===0&&this.debouncedReconnect()};handleBuildSuccess(t,o){let a=Ke(t),v=this.builds.get(a.id)||-1/0;if(v>a.from_timestamp+4){this.verbose&&O.debug(`Ignoring outdated update for "${a.module_path}".
  Expected: >=`,v,`
   Received:`,a.from_timestamp);return}var u=t.data.byteOffset+t.index+a.blob_length<=t.data.buffer.byteLength?new Uint8Array(t.data.buffer,t.data.byteOffset+t.index,a.blob_length):He||=new Uint8Array(0);if(a.loader===I.css)return f.clear(),this.needsConsoleClear&&(console.clear(),this.needsConsoleClear=!1),this.loaders.css.handleBuildSuccess(u,a,o);let d=a.id,p=this.indexOfModuleId(d);if(p===-1){this.verbose&&O.debug("Skipping reload for unknown module id:",d);return}if(this.verbose){var _=w.dependencies.modules[p].file_path;_.startsWith(this.cwd)&&(_=_.substring(this.cwd.length)),O.debug("Preparing to reload",_)}var E=t.index+a.blob_length,R=0;E>t.data.length&&E>4&&(E=t.data.length-4),E>4&&t.data.length>=E+4&&(new Uint8Array(this.hashBuffer.buffer).set(t.data.subarray(E,E+4)),R=this.hashBuffer[0]);var x=new S(a.id,p,a,u,1,R||0);u=null,x.timings.notify=o-a.from_timestamp,f.clear(),x.run().then(([P,D])=>{var W=P.file_path;W.startsWith(this.cwd)&&(W=W.substring(this.cwd.length)),this.needsConsoleClear&&(console.clear(),this.needsConsoleClear=!1),O.log(`[${e(D.total)}ms] Reloaded`,W)},P=>{if(!(typeof P=="object"&&P&&P instanceof L)){O.error("Hot Module Reload failed!",P);debugger}})}performFullReload(){typeof location<"u"&&(this.socket.readyState===this.socket.OPEN&&(this.reconnect=1,this.socket.close()),location.reload())}handleFileChangeNotification(t,o,a){let v=Je(t),u="";switch(v.loader){case I.css:{u=this.loaders.css.filePath(v);break}case I.js:case I.jsx:case I.tsx:case I.ts:case I.json:{let d=w.dependencies.graph.subarray(0,w.dependencies.graph_used).indexOf(v.id);d>-1&&(u=w.dependencies.modules[d].file_path);break}default:return}return this.handleFileChangeNotificationBase(o,v,u,a)}handleFileChangeNotificationBase(t,o,a,v){if(!(a&&a.length>0)){this.verbose&&O.debug("Unknown module changed, skipping");return}if((this.builds.get(o.id)||-1/0)>t){O.debug(`Received stale update for ${a}`);return}let d=2;switch(o.loader){case I.css:{this.builds.set(o.id,t),o.id=this.loaders.css.bundleId(),this.builds.set(o.id,t),d=1;break}case I.js:case I.jsx:case I.json:case I.ts:case I.tsx:{switch(this.javascriptReloader){case J.disable:break;case J.fast_refresh:{this.builds.set(o.id,t),d=1;break}case J.live:{d=0;break}}break}}switch(d){case 1:{v&&!this.buildCommandBufWithFilePath&&(this.buildCommandBufWithFilePath=new Uint8Array(4096+256));let p=v?this.buildCommandBufWithFilePath:this.buildCommandBuf;if(p[0]=v?ge.build_with_file_path:ge.build,this.buildCommandUArray[0]=t,p.set(this.buildCommandUArrayEight,1),this.buildCommandUArray[0]=o.id,p.set(this.buildCommandUArrayEight,5),v){se||(se=new TextEncoder),this.buildCommandUArray[0]=a.length,p.set(this.buildCommandUArrayEight,9);let _=se.encodeInto(a,p.subarray(13));this.socket.send(this.buildCommandBufWithFilePath.subarray(0,13+_.written))}else this.socket.send(this.buildCommandBuf);this.verbose&&O.debug(`Requesting update for ${a}`);break}case 0:{this.performFullReload();break}}}buildCommandBuf=new Uint8Array(9);buildCommandUArray=new Uint32Array(1);buildCommandUArrayEight=new Uint8Array(this.buildCommandUArray.buffer);hashBuffer=new Uint32Array(1);buildCommandBufWithFilePath;handleOpen=t=>{globalThis.clearTimeout(this.nextReconnectAttempt),setTimeout(()=>{this.socket&&this.socket.readyState==this.socket.OPEN&&(globalThis.clearTimeout(this.nextReconnectAttempt),this.reconnectDelay=16)},16)};handleMessage=t=>{let o=new Uint8Array(t.data),a=new te(o),v=$e(a),u=new te(o.subarray(a.index));switch(v.kind){case K.build_fail:{this.handleBuildFailure(u,v.timestamp);break}case K.build_success:{this.handleBuildSuccess(u,v.timestamp);break}case K.resolve_file:{let{id:_}=ze(u),E=this.builds.get(_)||0;if(E==0&&S.VERBOSE){O.debug(`Unknown module? ${_}`);return}let R=w.dependencies.graph.subarray(0,w.dependencies.graph_used).indexOf(_);var d="",p=I.js;if(R>-1)d=w.dependencies.modules[R].file_path;else{let x=this.loaders.css.findCSSLinkTag(_);x&&x.file.length&&(d=x.file)}if(!d||d.length===0){S.VERBOSE&&O.debug(`Unknown module? ${_}`);return}switch(d.substring(d.lastIndexOf("."))){case".css":{p=I.css;break}case".mjs":case".cjs":case".js":{p=I.js;break}case".json":{p=I.json;break}case".cts":case".mts":case".ts":{p=I.ts;break}case".tsx":{p=I.tsx;break}case".jsx":{p=I.jsx;break}default:{p=I.file;break}}this.handleFileChangeNotificationBase(E,{id:_,loader:p},d,!0);break}case K.file_change_notification:{this.handleFileChangeNotification(u,v.timestamp,!1);break}case K.file_change_notification_with_hint:{this.handleFileChangeNotification(u,v.timestamp,!0);break}case K.welcome:{let _=performance.now();this.hasWelcomed=!0;let E=De(u);switch(this.epoch=E.epoch,this.javascriptReloader=E.javascriptReloader,this.cwd=E.cwd,this.assetPrefixPath=E.assetPrefix,this.javascriptReloader){case J.fast_refresh:{O.log("HMR connected in",e(_-Q),"ms");break}case J.live:{O.log("Live reload connected in",e(_-Q),"ms");break}default:{O.log("Bun connected in",e(_-Q),"ms");break}}Q=_,this.epoch||O.warn("Internal HMR error");break}}};disableReconnect=!1;handleClose=t=>{this.reconnect!==0||this.disableReconnect||this.debouncedReconnect()}}let U=0;class L extends Error{constructor(t){super(t)}}class S{module_id=0;module_index=0;build;hash=0;timings={notify:0,decode:0,import:0,callbacks:0,total:0,start:0};static VERBOSE=!1;bytes;reloader;constructor(t,o,a,v,u,d){this.module_id=t,this.module_index=o,this.build=a,this.bytes=v,this.reloader=u,this.hash=d}async run(){U++;let t;try{t=await this._run()}finally{U--}return t}async _run(){let t=U,o=performance.now(),a=w.dependencies,v=w.dependencies.graph_used;var u=w.dependencies.modules.length>this.module_index&&w.dependencies.modules[this.module_index];w.dependencies=a.fork(this.module_index);var d="";let p=this.build.module_path.length>0&&this.build.module_path[0]==="/"?this.build.module_path.substring(1):this.build.module_path,_=this.hash>0&&this.build.module_path.length>0?`
//# sourceMappingURL=${globalThis.location.origin}/${p}.map?b=${this.hash.toString(16)}`:"";try{let P=new Blob(_.length>0?[this.bytes,_]:[this.bytes],{type:"text/javascript"});d=URL.createObjectURL(P),w.dependencies.blobToID.set(d,this.module_id),await import(d),this.bytes=null,URL.revokeObjectURL(d),this.timings.import=performance.now()-o}catch(P){throw w.dependencies=a,URL.revokeObjectURL(d),this.bytes=null,"__BunRenderHMRError"in globalThis&&globalThis.__BunRenderHMRError(P,u.file_path,u.id),u=null,P}w.dependencies.graph_used===this.module_index&&(w.dependencies.graph_used=v),d="",this.bytes=null,S.VERBOSE&&O.debug("Re-imported",w.dependencies.modules[this.module_index].file_path,"in",e(this.timings.import),". Running callbacks");let E=performance.now(),R=u?new Set(u.additional_updaters):new Set;try{switch(this.reloader){case 1:{let P=!1,D=u&&u.previousVersion&&u.previousVersion.id===u.id&&u.hasSameExports(u.previousVersion);var x=w.dependencies.modules[this.module_index];u&&u._update!==x._update&&(D?(u.previousVersion&&(x.previousVersion=u.previousVersion),x.additional_updaters=R):(u.boundUpdate||=u.update.bind(u),x.additional_updaters?x.additional_updaters.add(u.boundUpdate):x.additional_updaters=new Set([u.boundUpdate]),x.previousVersion=u));let W=Math.min(this.module_index+1,w.dependencies.graph_used);for(let Z=0;Z<=W;Z++){let l=w.dependencies.modules[Z];if(!l)continue;let n=!1;l.exports.__hmrDisable||(typeof l.dispose=="function"&&(l.dispose(),n=!0),typeof l.accept=="function"&&(l.accept(),n=!0),l.isRefreshBoundary&&(P=!0),n||l.update())}if(U===t&&P)c.RefreshRuntime.performReactRefresh(),D&&(u.previousVersion=null);else if(U===t)c.performFullRefresh();else return Promise.reject(new L(`Expected pendingUpdateCount: ${t} but received: ${U}`));break}}}catch(P){throw w.dependencies=a,w.dependencies.modules[this.module_index].additional_updaters=R,P}return this.timings.callbacks=performance.now()-E,S.VERBOSE&&O.debug("Ran callbacks",w.dependencies.modules[this.module_index].file_path,"in",e(this.timings.callbacks),"ms"),a=null,this.timings.total=this.timings.import+this.timings.callbacks+this.timings.notify,Promise.resolve([w.dependencies.modules[this.module_index],this.timings])}}class C{modules;graph;graph_used=0;blobToID=new Map;getModuleByBlobURL(t){let o=this.blobToID.get(t);return Number.isFinite(o)&&this.getModuleByID(o)}getFilePathFromBlob(t){let o=this.getModuleByBlobURL(t);if(!o)return null;let a=o.file_path;return a.startsWith(g.client.cwd)&&(a=a.substring(g.client.cwd.length)),a}getModuleByID(t){let o=this.graph.indexOf(t);return o>-1?this.modules[o]:null}loadDefaults(){this.modules=new Array(32),this.graph=new Uint32Array(32),this.graph_used=0}static loadWithDefaults(){let t=new C;return t.loadDefaults(),t}fork(t){let o=new C;return o.modules=this.modules.slice(),o.graph_used=t,o.graph=this.graph.slice(),o}}class w{constructor(t,o){if(this.id=t,this.file_path=o,Object.defineProperty(this,"name",{get(){return this.file_path},configurable:!1,enumerable:!1}),w.dependencies||(w.dependencies=w._dependencies),this.graph_index=w.dependencies.graph_used++,w.dependencies.graph.length<=this.graph_index){let a=new Uint32Array(w.dependencies.graph.length*4);a.set(w.dependencies.graph),w.dependencies.graph=a,w.dependencies.modules.length=a.length}w.dependencies.modules[this.graph_index]=this,w.dependencies.graph[this.graph_index]=this.id}previousVersion=null;hasSameExports(t){let o=Object.keys(this.exports),a=Object.keys(t.exports);if(o.length!==a.length)return!1;for(let v=0;v<o.length;v++)if(o[v]!==a[v])return!1;return!0}#e;get _update(){return this.#e}set _update(t){this.#e=t;var o=_e.get(this.file_path)}boundUpdate;update(){var t=_e.get(this.id);if(t?.length)for(let o of t)o(this.exports);this._update(this.exports)}static _dependencies=C.loadWithDefaults();exportAll(t){for(let o in t)this._exports[o]=t[o],Object.defineProperty(this.exports,o,{get:this._exports[o],configurable:!0,enumerable:!0})}static dependencies;file_path;_load=function(){};id=0;graph_index=0;_exports={};exports={}}class j extends w{constructor(t,o,a){super(t,o),this.refreshRuntimeBaseID=(this.file_path.length>7?this.id.toString(36):this.file_path)+"/",c.RefreshRuntime=c.RefreshRuntime||a,c.hasInjectedFastRefresh||(a.injectIntoGlobalHook(globalThis),c.hasInjectedFastRefresh=!0)}refreshRuntimeBaseID;isRefreshBoundary=!1;$r_(t,o){c.RefreshRuntime.register(t,this.refreshRuntimeBaseID+o)}$r(t){!c.RefreshRuntime.isLikelyComponentType(t)||this.$r_(t,t.name||t.displayName)}exportAll(t){super.exportAll(t);var o=!1,a=!0;for(let v in t){if(v==="__esModule")continue;o=!0;let u=t[v]();if(u&&typeof u=="function"&&!("name"in u)&&Object.isExtensible(u)){let d={get(){return v},enumerable:!1,configurable:!0};try{Object.defineProperties(u,{name:d,displayName:d})}catch{}}if(!c.RefreshRuntime.isLikelyComponentType(u)){a=!1;continue}this.$r_(u,v)}this.isRefreshBoundary=o&&a}loaded(t){this._update=t}}O={debug(...k){console.debug(...k)},error(...k){console.error(...k)},log(...k){console.log(...k)},warn(...k){console.warn(...k)}},Ye=w,Ze=j,Qe=g,Xe=Y,"document"in globalThis&&document.addEventListener("onimportcss",g.onCSSImport,{passive:!0}),globalThis.__BUN=g,globalThis.__BUN_ERROR=f}var se,me,Q,He,_e,O;var be,er,rr;{let e;(S=>(S[S.entry_point=0]="entry_point",S[S.stmt=1]="stmt",S[S.require=2]="require",S[S.dynamic=3]="dynamic",S[S.require_resolve=4]="require_resolve",S[S.at=5]="at",S[S.at_conditional=6]="at_conditional",S[S.url=7]="url"))(e||={});class r extends Error{constructor(c){super(c.message),this.name=c.name,this.data=c}data;get position(){return this.data.position}get[Symbol.toStringTag](){return`${this.name}: ${this.message}`}}class i extends r{constructor(c){super(c),this.name=c.name,this.data=c}data;get importKind(){return this.data.importKind}get specifier(){return this.data.specifier||""}}er=i,be=r,rr=e}var ft=Symbol.for,nr=Object.create,Lr=Object.getOwnPropertyDescriptors,H=Object.defineProperty,Or=Object.getPrototypeOf,ar=Object.prototype.hasOwnProperty,Pr=Object.getOwnPropertyNames,Tr=Object.getOwnPropertyDescriptor,or=e=>H(e,"__esModule",{value:!0,configurable:!0}),Cr=(e,r,i)=>{for(let s in i)ar.call(e,s)||H(e,s,{get:()=>r()[i[s]],enumerable:!0,configurable:!0});return e},qr=e=>ur(or(H(e!=null?nr(Or(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0,configurable:!0}:{value:e,enumerable:!0,configurable:!0})),e),tr=Symbol.for("CommonJSTransformed"),Se=Symbol.for("CommonJS"),ke=(e,r)=>{var i,s=!1;let c=function(){if(s)return i.exports;s=!0,e((i={exports:{}},i),i.exports);let f=typeof i.exports;return(f==="object"||f==="function")&&!i.exports[tr]&&Object.isExtensible(i.exports)&&(Object.defineProperty(i.exports,tr,{value:!0,enumerable:!1,configurable:!1}),"default"in i.exports||Object.defineProperty(i.exports,"default",{get(){return i.exports},set(A){if(A!==i.exports)return i.exports=A,!0},enumerable:!1,configurable:!0})),i.exports};return c[Se]=!0,c},Fr=ke,lr=e=>e!=null&&typeof e=="object"&&(e.default&&e.default[Se]||e[Se]),sr=e=>lr(e)?e.default():e;sr.d=e=>e;var Nr=ke,jr=(e,r)=>(Object.defineProperty(e,"name",{value:r,enumerable:!1,configurable:!0}),e),Vr=(e,r)=>{for(var i in r)H(e,i,{get:r[i],enumerable:!0,configurable:!0,set:s=>r[i]=()=>s})},Wr=(e,r)=>{for(var i in r)H(e,i,{get:()=>r[i],set:s=>r[i]=s,enumerable:!0,configurable:!0})},$r=(e,r)=>{H(e,"default",{get:()=>r,set:i=>r=i,enumerable:!0,configurable:!0})},ur=(e,r,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of Pr(r))!ar.call(e,s)&&s!=="default"&&H(e,s,{get:()=>r[s],configurable:!0,enumerable:!(i=Tr(r,s))||i.enumerable});return e};function ir(e){for(let r in e)return!0;return!1}function Dr(e,r){var i=nr(r,Lr(e));for(let s in r)i[s]===void 0&&(i[s]=r[s]);return i}var Jr=(e,r)=>ir(r)?ir(e)?Dr(e,r):r:e;var fr=qe(dr());var Pe={};Te(Pe,{_getMountedRootCount:()=>rt,collectCustomHooksForSignature:()=>vr,createSignatureFunctionForTransform:()=>tt,findAffectedHostInstances:()=>Xr,getFamilyByID:()=>Zr,getFamilyByType:()=>Qr,hasUnrecoverableErrors:()=>et,injectIntoGlobalHook:()=>br,isLikelyComponentType:()=>it,performReactRefresh:()=>Yr,register:()=>Ue,setSignature:()=>ve});var Ie="for"in Symbol?Symbol.for("react.forward_ref"):60112,Re="for"in Symbol?Symbol.for("react.memo"):60115,Le=typeof WeakMap=="function"?WeakMap:Map,Ee=new Map,Ae=new Le,b=new Le,Me=new Le,ue=[],de=new Map,ce=new Map,G=new Set,X=new Set,ie=typeof WeakMap=="function"?new WeakMap:null,fe=!1;function he(e){if(e.fullKey!==null)return e.fullKey;let r=e.ownKey,i;try{i=e.getCustomHooks()}catch{return e.forceReset=!0,e.fullKey=r,r}for(let s=0;s<i.length;s++){let c=i[s];if(typeof c!="function")return e.forceReset=!0,e.fullKey=r,r;let B=b.get(c);if(B===void 0)continue;let f=he(B);B.forceReset&&(e.forceReset=!0),r+=`
/*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ^ happend here                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       */
---
`+f}return e.fullKey=r,r}function Kr(e,r){let i=b.get(e),s=b.get(r);return i===void 0&&s===void 0?!0:!(i===void 0||s===void 0||he(i)!==he(s)||s.forceReset)}function cr(e){return e.prototype&&e.prototype.isReactComponent}function Gr(e,r){return cr(e)||cr(r)?!1:!!Kr(e,r)}function zr(e){return Me.get(e)}function Hr(e){let r=new Map;return e.forEach((i,s)=>{r.set(s,i)}),r}function hr(e){let r=new Set;return e.forEach(i=>{r.add(i)}),r}function Oe(e,r){try{return e[r]}catch{return}}function Yr(){if(ue.length===0||fe)return null;fe=!0;try{let e=new Set,r=new Set,i=ue;ue=[],i.forEach(U=>{let[L,S]=U,C=L.current;Me.set(C,L),Me.set(S,L),L.current=S,Gr(C,S)?r.add(L):e.add(L)});let s={updatedFamilies:r,staleFamilies:e};de.forEach(U=>{U.setRefreshHandler(zr)});let c=!1,B=null,f=hr(X),A=hr(G),g=Hr(ce);if(f.forEach(U=>{let L=g.get(U);if(L===void 0)throw new Error("Could not find helpers for a root. This is a bug in React Refresh.");if(X.has(U),ie===null||!ie.has(U))return;let S=ie.get(U);try{L.scheduleRoot(U,S)}catch(C){c||(c=!0,B=C)}}),A.forEach(U=>{let L=g.get(U);if(L===void 0)throw new Error("Could not find helpers for a root. This is a bug in React Refresh.");G.has(U);try{L.scheduleRefresh(U,s)}catch(S){c||(c=!0,B=S)}}),c)throw B;return s}finally{fe=!1}}function Ue(e,r){if(e===null||typeof e!="function"&&typeof e!="object"||Ae.has(e))return;let i=Ee.get(r);if(i===void 0?(i={current:e},Ee.set(r,i)):ue.push([i,e]),Ae.set(e,i),typeof e=="object"&&e!==null)switch(Oe(e,"$$typeof")){case Ie:Ue(e.render,r+"$render");break;case Re:Ue(e.type,r+"$type");break}}function ve(e,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3?arguments[3]:void 0;if(b.has(e)||b.set(e,{forceReset:i,ownKey:r,fullKey:null,getCustomHooks:s||(()=>[])}),typeof e=="object"&&e!==null)switch(Oe(e,"$$typeof")){case Ie:ve(e.render,r,i,s);break;case Re:ve(e.type,r,i,s);break}}function vr(e){let r=b.get(e);r!==void 0&&he(r)}function Zr(e){return Ee.get(e)}function Qr(e){return Ae.get(e)}function Xr(e){let r=new Set;return G.forEach(i=>{let s=ce.get(i);if(s===void 0)throw new Error("Could not find helpers for a root. This is a bug in React Refresh.");s.findHostInstancesForRefresh(i,e).forEach(c=>{r.add(c)})}),r}function br(e){let r=e.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(r===void 0){let B=0;e.__REACT_DEVTOOLS_GLOBAL_HOOK__=r={renderers:new Map,supportsFiber:!0,inject(f){return B++},onScheduleFiberRoot(f,A,g){},onCommitFiberRoot(f,A,g,U){},onCommitFiberUnmount(){}}}if(r.isDisabled){console.warn("Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). Fast Refresh is not compatible with this shim and will be disabled.");return}let i=r.inject;r.inject=function(B){let f=i.apply(this,arguments);return typeof B.scheduleRefresh=="function"&&typeof B.setRefreshHandler=="function"&&de.set(f,B),f},r.renderers.forEach((B,f)=>{typeof B.scheduleRefresh=="function"&&typeof B.setRefreshHandler=="function"&&de.set(f,B)});let s=r.onCommitFiberRoot,c=r.onScheduleFiberRoot||(()=>{});r.onScheduleFiberRoot=function(B,f,A){return fe||(X.delete(f),ie!==null&&ie.set(f,A)),c.apply(this,arguments)},r.onCommitFiberRoot=function(B,f,A,g){let U=de.get(B);if(U!==void 0){ce.set(f,U);let L=f.current,S=L.alternate;if(S!==null){let C=S.memoizedState!=null&&S.memoizedState.element!=null&&G.has(f),w=L.memoizedState!=null&&L.memoizedState.element!=null;!C&&w?(G.add(f),X.delete(f)):C&&w||(C&&!w?(G.delete(f),g?X.add(f):ce.delete(f)):!C&&!w&&g&&X.add(f))}else G.add(f)}return s.apply(this,arguments)}}function et(){return!1}function rt(){return G.size}function tt(){let e,r,i=!1;return function(s,c,B,f){if(typeof c=="string")return e||(e=s,r=typeof f=="function"),s!=null&&(typeof s=="function"||typeof s=="object")&&ve(s,c,B,f),s;!i&&r&&(i=!0,vr(e))}}function it(e){switch(typeof e){case"function":{if(e.prototype!=null){if(e.prototype.isReactComponent)return!0;let i=Object.getOwnPropertyNames(e.prototype);if(i.length>1||i[0]!=="constructor"||e.prototype.__proto__!==Object.prototype)return!1}let r=e.name||e.displayName;return typeof r=="string"&&/^[A-Z]/.test(r)}case"object":{if(e!=null)switch(Oe(e,"$$typeof")){case Ie:case Re:return!0;default:return!1}return!1}default:return!1}}globalThis.process||={env:{},cwd(){return"/bun-fake-dir/"}};return kr(nt);})();
// ---

Stack trace:

  `lr` node_modules.bun:7:7023
  `sr` node_modules.bun:7:7060
  λ()  node_modules/@nextui-org/react/esm/textarea/textarea.js:9:21

Info:

bun v0.1.7
macOS 12.5.0 (Apple Silicon)
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.79 Safari/537.36
Pathname: /

Additional information

Repo for repro: https://github.com/hellsan631/mycraft2

@hellsan631 hellsan631 added bug Something isn't working needs repro Needs an example to reproduce labels Aug 8, 2022
@xhyrom
Copy link
Collaborator

xhyrom commented Aug 8, 2022

try use bun bun

@hellsan631
Copy link
Author

try use bun bun

I tried this and it didn't fix the issue. Also tried making everything a non-default export, and using RN import format for react: import React with import * as React.

@Jarred-Sumner
Copy link
Collaborator

It's an issue with require

@hellsan631
Copy link
Author

Just updating that 0.1.8 didn't solve the require issue outlined (it solved a few others)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs repro Needs an example to reproduce
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants