Skip to content

uncaught referenceerror: cannot access 'L' before initialization #9435

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

Closed
3 tasks
YudhistiraA opened this issue Nov 2, 2023 · 16 comments
Closed
3 tasks

uncaught referenceerror: cannot access 'L' before initialization #9435

YudhistiraA opened this issue Nov 2, 2023 · 16 comments
Labels
Package: vue Issues related to the Sentry Vue SDK

Comments

@YudhistiraA
Copy link

YudhistiraA commented Nov 2, 2023

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/vue

SDK Version

7.80

Framework Version

No response

Link to Sentry event

No response

SDK Setup

image

    if(import.meta.env.VITE_SENTRY_ORG_DSN_XXX) {
      Sentry.init({
                    app,
                    dsn                     : import.meta.env.VITE_SENTRY_ORG_DSN,
                    environment             : import.meta.env.VITE_APP_ENV,
                    integrations            : [
                      new Sentry.Replay(),
                    ],
                    replaysSessionSampleRate: import.meta.env.VITE_SENTRY_ORG_REPLAY_SESSION_SAMPLE_RATE,
                    replaysOnErrorSampleRate: import.meta.env.VITE_SENTRY_ORG_REPLAY_ON_ERRORSAMPLE_RATE,
                  });
    }
  },

Steps to Reproduce

runs fine when run but gets the error during build

Expected Result

will be fine and works well

Actual Result

get
uncaught referenceerror: cannot access 'L' before initialization

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Nov 2, 2023
@github-actions github-actions bot added the Package: vue Issues related to the Sentry Vue SDK label Nov 2, 2023
@mydea
Copy link
Member

mydea commented Nov 2, 2023

Hello,

could you maybe provide a bit more details on your error? A stacktrace would be helpful (e.g. what you see when you click on @sentry-internal-dxxxxx in the console), or if you have it, a link to a sentry issue captured for this (if this was captured by Sentry).

@inikoo
Copy link

inikoo commented Nov 3, 2023

hello, this it what is shown when click on @sentry-internal-dxxxxx

image

it is never captured by sentry

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Nov 3, 2023
@inikoo
Copy link

inikoo commented Nov 3, 2023

It was working in previous versions of sentry (2 weeks ago) it broke in one the last release , usually update npm packages every couple of weeks

@mydea
Copy link
Member

mydea commented Nov 3, 2023

Hmm, weird. Also the SDK version you mentioned 7.80 does not exist yet - the latest is 7.77. What version exactly are you on?

Can you try building without minification (or in dev mode) and see if it happens there as well? It's hard to say where this come from based on the minified stracktrace.

@inikoo
Copy link

inikoo commented Nov 3, 2023

hello, sorry for send the minify version :P

image image

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Nov 3, 2023
@inikoo
Copy link

inikoo commented Nov 3, 2023

I installed the package like this:

npm install --save @sentry/vue

npm -v @sentry/vue
9.6.7

@mydea
Copy link
Member

mydea commented Nov 3, 2023

I wonder, how do you build your application? And could you check your lockfile to make sure only a single version of all the SDK packages is installed (e.g. you don't have leftover older versions somewhere - this can sometimes conflict!)

@inikoo
Copy link

inikoo commented Nov 3, 2023

`"private": true,
"type": "module",
"scripts": {
"build.organisation": "vite build --config vite.organisation.config.js --minify false",
},

i using vite`

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Nov 3, 2023
@inikoo
Copy link

inikoo commented Nov 3, 2023

looks like is only version 7.77
image

@inikoo
Copy link

inikoo commented Nov 3, 2023

Note that if i use version 7.74.0 or lower it works ok the problem start if install from 7.75

"@sentry/vue": "7.74.0",

has no problem

@AbhiPrasad
Copy link
Member

Can you provide a reproduction with a bare-bones vue+vite app? I was unable to reproduce with a test app.

@getsantry getsantry bot moved this to Waiting for: Community in GitHub Issues with 👀 Nov 3, 2023
@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 Nov 3, 2023
@inikoo
Copy link

inikoo commented Nov 3, 2023

Ohhhh i found what causing the problem in

vite.config.js

i had this build config:

  build  : {
        rollupOptions: {
          output: {
            manualChunks(id) {
              if (id.includes('node_modules')) {
                return id.toString().
                    split('node_modules/')[1].split(
                    '/')[0].toString();
              }
            },
          },
        },
      },

after removing that all versions works 🥳 , so all ok, but just let you know, sentry is not compatible with that vite build conf,

you can close this issue if you want

@AbhiPrasad
Copy link
Member

I think the build config issues might be from the @sentry/ and @sentry-internal prefix on the packages.

Closing - please let us know if there are any other issues. Thanks!

@one-flower
Copy link

May I ask if the current new version has fixed this issue?

@Anton-Zelenkov
Copy link

Anton-Zelenkov commented Feb 26, 2024

Still have this problem. It is observed in Vitе if manual chunking is set:
image
image

It can be fixed this way:
image

@m-Jawa-d
Copy link

This solution has worked just remove build object from vite.config.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: vue Issues related to the Sentry Vue SDK
Projects
Archived in project
Development

No branches or pull requests

7 participants