You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been trying to connect to axiom and send logs. while in development everything works fine.
but in deployment I keep receiving the follwoing error
unable to determine transport target for "@axiomhq/pino"
at fixTarget (J:\...redecated...\.output\server\node_modules\pino\lib\transport.js:146:13)
at Function.transport (J:\...redecated...\.output\server\node_modules\pino\lib\transport.js:116:22)
am using Nuxt3 with vite.
I did try to turn off treeshaking in nuxt.config.ts
vite:{build:{rollupOptions:{// Exclude the package from tree shaking// external: ['@axiomhq']treeshake: false}}},
Note: it works just fine with pino-pretty. but am not sure what is happening in the building step.
i spent my whole day playing around .. and I have no clue... what is happening on the build step
Debugging the production version using this modification :
functionfixTarget(origin){origin=bundlerOverrides[origin]||originif(isAbsolute(origin)||origin.indexOf('file://')===0){returnorigin}if(origin==='pino/file'){returnjoin(__dirname,'..','file.js')}letfixTargetfor(constfilePathofcallers){try{constcontext=filePath==='node:repl'
? process.cwd()+sep
: filePaththrownewError(createRequire(context).resolve(origin))console.log(createRequire(context).resolve(origin))fixTarget=createRequire(context).resolve(origin)break}catch(err){// Silent catchthrownewError(err)continue}}if(!fixTarget){thrownewError(`unable to determine transport target for "${origin}"`)}returnfixTarget}}
shows that the @axiomhq\pino\dist\cjs\index.cjs is what it tries to use.
though in vite .cjs is depreciated and it should use .mjs
also in the build output the cjs folder is deleted and doesn't exists, which causes this error.
The text was updated successfully, but these errors were encountered:
Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.
These bundling issues are quite tricky, so if you would like to also send a PR... that would be amazing.
Hello !
thanks for the great package!
I have been trying to connect to axiom and send logs. while in development everything works fine.
but in deployment I keep receiving the follwoing error
am using Nuxt3 with vite.
I did try to turn off treeshaking in
nuxt.config.ts
but still the same issue.
Here is my logger code:
Note: it works just fine with pino-pretty. but am not sure what is happening in the building step.
i spent my whole day playing around .. and I have no clue... what is happening on the build step
Debugging the production version using this modification :
shows that the
@axiomhq\pino\dist\cjs\index.cjs
is what it tries to use.though in vite
.cjs
is depreciated and it should use.mjs
also in the build output the
cjs
folder is deleted and doesn't exists, which causes this error.The text was updated successfully, but these errors were encountered: