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

[RC.5] Identifier '$id_944007393' has already been declared #14313

Closed
ahoiroman opened this issue Jul 13, 2022 · 10 comments
Closed

[RC.5] Identifier '$id_944007393' has already been declared #14313

ahoiroman opened this issue Jul 13, 2022 · 10 comments
Assignees

Comments

@ahoiroman
Copy link

Environment

Nuxt project info:                                                                                                                                                     21:44:45

------------------------------
- Operating System: `Darwin`
- Node Version:     `v18.2.0`
- Nuxt Version:     `3.0.0-rc.5`
- Package Manager:  `npm@8.9.0`
- Builder:          `vite`
- User Config:      `build`, `buildModules`, `modules`, `publicRuntimeConfig`, `privateRuntimeConfig`, `globalName`, `app`, `router`, `intlify`, `axios`, `proxy`, `auth`, `tailwindcss`, `googleFonts`
- Runtime Modules:  `@nuxtjs-alt/auth@1.1.20`, `@nuxtjs-alt/axios@1.0.12`, `@nuxtjs-alt/pinia@1.0.7`, `@nuxt/content@2.0.1`, `@nuxtjs/tailwindcss@5.3.0`
- Build Modules:    `@intlify/nuxt3@0.2.3`, `@nuxtjs-alt/google-fonts@1.0.5`
------------------------------

Reproduction

Run npm run dev

Describe the bug

After upgrading from rc4 to rc5, I am getting this error:

✔ Nitro built in 486 ms nitro 21:42:51
[nuxt] [request error] Identifier '$id_944007393' has already been declared
at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:117:18)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:361:14)
at async link (node:internal/modules/esm/module_job:70:21)

Followed by

<--- Last few GCs --->

[27327:0x140058000]    45253 ms: Mark-sweep (reduce) 4112.3 (4123.5) -> 4093.2 (4104.4) MB, 6.1 / 0.0 ms  (average mu = 0.882, current mu = 0.897) allocation failure; scavenge might not succeed
[27327:0x140058000]    45284 ms: Mark-sweep (reduce) 4112.3 (4123.6) -> 4112.3 (4123.6) MB, 5.8 / 0.0 ms  (average mu = 0.856, current mu = 0.814) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
 1: 0x104d81d0c node::Abort() [/opt/homebrew/Cellar/node/18.2.0/bin/node]
 2: 0x104d82d20 node::OnFatalError(char const*, char const*) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
 3: 0x104edd608 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
 4: 0x104edd584 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
 5: 0x10504c438 v8::internal::TimedHistogramScope& v8::base::Optional<v8::internal::TimedHistogramScope>::emplace<v8::internal::TimedHistogram*&, v8::internal::Isolate*&>(v8::internal::TimedHistogram*&, v8::internal::Isolate*&) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
 6: 0x10504b2e8 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
 7: 0x10504128c v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
 8: 0x105041948 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
 9: 0x105026bf8 v8::internal::MaybeHandle<v8::internal::SeqOneByteString> v8::internal::FactoryBase<v8::internal::Factory>::NewRawStringWithMap<v8::internal::SeqOneByteString>(int, v8::internal::Map, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
10: 0x10526a4ec v8::internal::String::SlowFlatten(v8::internal::Isolate*, v8::internal::Handle<v8::internal::ConsString>, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
11: 0x1052fceb4 v8::internal::RegExpImpl::IrregexpExec(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSRegExp>, v8::internal::Handle<v8::internal::String>, int, v8::internal::Handle<v8::internal::RegExpMatchInfo>, v8::internal::RegExp::ExecQuirks) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
12: 0x1052fca3c v8::internal::RegExp::Exec(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSRegExp>, v8::internal::Handle<v8::internal::String>, int, v8::internal::Handle<v8::internal::RegExpMatchInfo>, v8::internal::RegExp::ExecQuirks) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
13: 0x10531836c v8::internal::Runtime_RegExpExec(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
14: 0x104bed5ac Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/opt/homebrew/Cellar/node/18.2.0/bin/node]
15: 0x104c47e9c Builtins_RegExpReplace [/opt/homebrew/Cellar/node/18.2.0/bin/node]
16: 0x104bdf250 Builtins_StringPrototypeReplace [/opt/homebrew/Cellar/node/18.2.0/bin/node]
17: 0xa00120614 
18: 0xa000f5bb4 
19: 0xa000f43e0 
20: 0x104c0c7b0 Builtins_ArrayMap [/opt/homebrew/Cellar/node/18.2.0/bin/node]
21: 0xa0010d36c 
22: 0xa0010d5a4 
23: 0xa001125bc 
24: 0xa0011605c 
25: 0x104ba9fb4 Builtins_AsyncFunctionAwaitRejectClosure [/opt/homebrew/Cellar/node/18.2.0/bin/node]
26: 0x104c395d8 Builtins_PromiseRejectReactionJob [/opt/homebrew/Cellar/node/18.2.0/bin/node]
27: 0x104b9bf10 Builtins_RunMicrotasks [/opt/homebrew/Cellar/node/18.2.0/bin/node]
28: 0x104b75544 Builtins_JSRunMicrotasksEntry [/opt/homebrew/Cellar/node/18.2.0/bin/node]
29: 0x104fe5138 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
30: 0x104fe5618 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
31: 0x105006980 v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
32: 0x1050067ac v8::internal::MicrotaskQueue::PerformCheckpointInternal(v8::Isolate*) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
33: 0x104cb9ad0 node::InternalCallbackScope::Close() [/opt/homebrew/Cellar/node/18.2.0/bin/node]
34: 0x104d87880 node::fs::FileHandle::CloseReq::Resolve() [/opt/homebrew/Cellar/node/18.2.0/bin/node]
35: 0x104d88028 node::fs::FileHandle::ClosePromise()::$_0::__invoke(uv_fs_s*) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
36: 0x107263134 uv__work_done [/opt/homebrew/Cellar/libuv/1.44.1_1/lib/libuv.1.dylib]
37: 0x107266484 uv__async_io [/opt/homebrew/Cellar/libuv/1.44.1_1/lib/libuv.1.dylib]
38: 0x1072761dc uv__io_poll [/opt/homebrew/Cellar/libuv/1.44.1_1/lib/libuv.1.dylib]
39: 0x1072668d8 uv_run [/opt/homebrew/Cellar/libuv/1.44.1_1/lib/libuv.1.dylib]
40: 0x104cbac80 node::SpinEventLoop(node::Environment*) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
41: 0x104e1ebcc node::worker::Worker::Run() [/opt/homebrew/Cellar/node/18.2.0/bin/node]
42: 0x104e21040 node::worker::Worker::StartThread(v8::FunctionCallbackInfo<v8::Value> const&)::$_3::__invoke(void*) [/opt/homebrew/Cellar/node/18.2.0/bin/node]
43: 0x18a56c26c _pthread_start [/usr/lib/system/libsystem_pthread.dylib]
44: 0x18a56708c thread_start [/usr/lib/system/libsystem_pthread.dylib]
[1]    27314 abort      npm run dev

Additional context

No response

Logs

No response

@Bekzod101001
Copy link

i also tried to delete .nuxt folder and run dev server - not helped

@ahoiroman
Copy link
Author

This was caused by an import of

import "vue-toastification/dist/index.css";

in a plugin. Removing this and moving it to tailwind.css solved the problem.

@pi0 pi0 reopened this Jul 14, 2022
@misaon
Copy link
Contributor

misaon commented Jul 14, 2022

Same problem in Nuxt module definition with

nuxtOptions.css.push(
  'vue-toastification/dist/index.css',
)

@pi0
Copy link
Member

pi0 commented Jul 14, 2022

Related cases: https://github.com/nuxt/framework/discussions/5885#discussioncomment-3140790

Any reproduction would be appreciated to pinpoint this issue 🙏

@misaon
Copy link
Contributor

misaon commented Jul 14, 2022

@pi0 reproduction here: https://stackblitz.com/edit/github-gysihc?file=nuxt.config.ts

@pi0 pi0 added bug and removed pending triage labels Jul 14, 2022
@pi0
Copy link
Member

pi0 commented Jul 14, 2022

This issue is chunk hash conflict.

Update: #14313

workarounds:

  1. Enable experimental viteNode:
import { defineNuxtConfig } from 'nuxt'

export default defineNuxtConfig({
  experimental: {
    viteNode: true
  }
})
  1. Downgrade to RC.4 (Cannot downgrade nuxi - always 3.0.0-rc.4 present #14234)

@pi0 pi0 self-assigned this Jul 14, 2022
@pi0 pi0 pinned this issue Jul 14, 2022
@pi0 pi0 changed the title Identifier '$id_944007393' has already been declared after upgrading to rc-5 Identifier '$id_944007393' has already been declared Jul 14, 2022
@pi0 pi0 changed the title Identifier '$id_944007393' has already been declared [RC.4] Identifier '$id_944007393' has already been declared Jul 14, 2022
@pi0 pi0 changed the title [RC.4] Identifier '$id_944007393' has already been declared [RC.5] Identifier '$id_944007393' has already been declared Jul 14, 2022
@misaon
Copy link
Contributor

misaon commented Jul 14, 2022

This issue is chunk hash conflict.

As a quick workaround, enable experimental viteNode:

import { defineNuxtConfig } from 'nuxt'

export default defineNuxtConfig({
  experimental: {
    viteNode: true
  }
})

it's a shame I'm getting into a loop with the following: #13587 😄

@pi0
Copy link
Member

pi0 commented Jul 14, 2022

Added workaround to pin the version.

@pi0
Copy link
Member

pi0 commented Jul 14, 2022

Hash collision issue is fixed with ohash sub-dependency (unjs/ohash#12)

Please remove workarounds, .nuxt and upgrade lockfile using:

npx nuxi@latest upgrade --force

@pi0
Copy link
Member

pi0 commented Jul 18, 2022

Issues should be fixed in the latest RC.6 release.

@pi0 pi0 unpinned this issue Jul 18, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants