finkinfridom/payload-auth0-plugin

Error "document is not defined" at build

ixoye36 opened this issue · 4 comments

I get this error when trying to build my project after having followed the readMe.

ReferenceError: document is not defined
    at Object.276 (/Users/MYPATH/node_modules/payload-auth0-plugin/dist/components/index.js:1:141)
    at t (/Users/MYPATH/node_modules/payload-auth0-plugin/dist/components/index.js:21:3975)
    at /Users/MYPATH/node_modules/payload-auth0-plugin/dist/components/index.js:21:4646
    at Object.<anonymous> (/Users/MYPATH/node_modules/payload-auth0-plugin/dist/components/index.js:21:4671)
    at Module._compile (node:internal/modules/cjs/loader:1255:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
    at Object.require.extensions.<computed> [as .js] (/Users/MYPATH/node_modules/ts-node/src/index.ts:1608:43)
    at Module.load (node:internal/modules/cjs/loader:1113:32)
    at Function.Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1137:19)
[nodemon] app crashed - waiting for file changes before starting...

I also tried to build my projet after having manually added the package (without install via npm) to my project. I still get this error.

Any idea where the issue could come from ? Are lib like browserify required ?

hey @ixoye36 , sorry but I missed the notification for the issue. I'll have a look and let you know. which version are you targeting?

hey @finkinfridom

If I am not mistaken the issue was found in v0.1.4 so I believe it is still there (with the latest payload version)

I fixed it locally but I do not remember what I did. I will come back here if I find it.

I'm using payload 2.0 and this still bug

same here =(