logrocket icon indicating copy to clipboard operation
logrocket copied to clipboard

Does not provided named default

Open fredski02 opened this issue 1 year ago • 14 comments

I followed the guide exactly from here https://nuxt.com/modules/logrocket

my node version is : 16.20.0 my nuxt version is 3.3.1 my nuxt-logrocket version is 2.0.6

nuxt.config.ts

  modules: [
    'nuxt-logrocket',
 ] 
 ...
  logRocket: {
    id: `NUXT_LOG_ROW`,
    dev: true
  },

In my browser, i get the following error

caught SyntaxError: The requested module '/_nuxt/node_modules/.pnpm/[email protected]/node_modules/logrocket/dist/build.umd.js?v=d10ca332' does not provide an export named 'default' (at plugin.client.mjs:1:1)

fredski02 avatar Jun 21 '23 10:06 fredski02

@Atinux Since you had the same issue on nuxt tailwind, I was wondering if you could point me in the right direction as I couldn't find any commits that fixed this issue.

farzadso avatar Jun 21 '23 13:06 farzadso

I guess @ineshbose could help

atinux avatar Jun 27 '23 12:06 atinux

Having the same issue

camille500 avatar Jul 07 '23 06:07 camille500

@farzadso I tried to investigate this issue (coming from client plugin) but can't say for fix. Do you know what exact issue you are referring to from the Tailwind module? (I am unable to recall)

ineshbose avatar Jul 07 '23 07:07 ineshbose

@ineshbose The only relevant discussion I found was this : https://github.com/nuxt/nuxt/issues/13247

Hope it rings some bells.

farzadso avatar Jul 07 '23 11:07 farzadso

@ineshbose The only relevant discussion I found was this : https://github.com/nuxt/nuxt/issues/13247

Hope it rings some bells.

Oh this was because we weren't bundling a dependency with the module (was added to unbuild.externals) and we anyway switched dependency. So it wasn't related.. (let me continue going through the discussion and experimenting in Stackblitz)

ineshbose avatar Jul 07 '23 11:07 ineshbose

@ineshbose The only relevant discussion I found was this : nuxt/nuxt#13247 Hope it rings some bells.

Oh this was because we weren't bundling a dependency with the module (was added to unbuild.externals) and we anyway switched dependency. So it wasn't related.. (let me continue going through the discussion and experimenting in Stackblitz)

Yeah, I went through the commits and didn't find anything related.

Much appreciated.

farzadso avatar Jul 07 '23 12:07 farzadso

@farzadso any luck with this issue - we'd love to try working with Logrocket but cannot seem to get past this issue.

dolbex avatar Jul 19 '23 01:07 dolbex

Do you think this issue could be related?

Me-Phew avatar Jul 20 '23 16:07 Me-Phew

@Me-Phew I upgrade nuxt to 3.6.5 and the issue still exists.

farzadso avatar Jul 22 '23 10:07 farzadso

@farzadso would we be able to add logrocket to imports like so:

addImports({
      name: 'default',
      as: 'logRocket',
      from: 'logrocket'
})

and then in the plugin use:

import { logRocket } from '#imports'

I tried it on the repo playground but probably not testing properly.

ineshbose avatar Jul 22 '23 10:07 ineshbose

@ineshbose Can you give me a link to your playground please?

farzadso avatar Jul 22 '23 10:07 farzadso

Closed the tab... it was just the repo opened on Stackblitz with the above change!

ineshbose avatar Jul 22 '23 11:07 ineshbose

@ineshbose Even adding your proposed changes doesn't fix it. You can see the changes on v2.0.9.

farzadso avatar Jul 22 '23 11:07 farzadso