{"record":{"id":"dc15eb74a4a0514d","repo":"grafana/k6","slug":"you-are-trying-to-access-identifier-q-this-likel","errorCode":null,"errorMessage":"you are trying to access identifier %q, this likely is due to mixing ECMAScript Modules (ESM) and CommonJS syntax. This isn't supported in the JavaScript standard, please use only one or the other","messagePattern":"you are trying to access identifier %q, this likely is due to mixing ECMAScript Modules \\(ESM\\) and CommonJS syntax\\. This isn't supported in the JavaScript standard, please use only one or the other","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/bundle.go","lineNumber":511,"sourceCode":"\t\t\tlogger := b.preInitState.Logger\n\t\t\tif shouldWarn {\n\t\t\t\tlogger.Warningf(\"open() was used and is currently relative to '%s', but in the future \"+\n\t\t\t\t\t\"it will be aligned with how `require` and imports work and will be relative to '%s'. This means \"+\n\t\t\t\t\t\"that in the future open will open relative path relative to the module/file it is written in. \"+\n\t\t\t\t\t\"You can future proof this by using `import.meta.resolve()` to get relative paths to the file it \"+\n\t\t\t\t\t\"is written in the current k6 version.\", pwd, otherPath)\n\t\t\t\terr = b.preInitState.Usage.Uint64(\"deprecations/openRelativity\", 1)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogger.WithError(err).Warn(\"failed reporting usage of deprecated relativity of open()\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn openImpl(rt, b.filesystems[\"file\"], pwd, filename, args...)\n\t})\n\twarnAboutModuleMixing := func(name string) {\n\t\twarnFunc := rt.ToValue(func() error {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"you are trying to access identifier %q, this likely is due to mixing \"+\n\t\t\t\t\t\"ECMAScript Modules (ESM) and CommonJS syntax. \"+\n\t\t\t\t\t\"This isn't supported in the JavaScript standard, please use only one or the other\",\n\t\t\t\tname)\n\t\t})\n\t\terr := rt.GlobalObject().DefineAccessorProperty(name, warnFunc, warnFunc, sobek.FLAG_FALSE, sobek.FLAG_FALSE)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf(\"failed to set '%s' global object: %w\", name, err))\n\t\t}\n\t}\n\twarnAboutModuleMixing(\"module\")\n\twarnAboutModuleMixing(\"exports\")\n\n\trt.SetFinalImportMeta(func(o *sobek.Object, mr sobek.ModuleRecord) {\n\t\terr := o.Set(\"resolve\", func(specifier string) (string, error) {\n\t\t\tu, err := modSys.Resolve(mr, specifier)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err","sourceCodeStart":493,"sourceCodeEnd":529,"githubUrl":"https://github.com/grafana/k6/blob/3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee/internal/js/bundle.go#L493-L529","documentation":"Error \"you are trying to access identifier %q, this likely is due to mixing ECMAScript Modules (ESM) and CommonJS syntax. This isn't supported in the JavaScript standard, please use only one or the other\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/js/bundle.go:509 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pick one module system for the whole script: use either import/export (ESM) or require/module.exports (CJS), not both","Convert CommonJS require calls to ESM imports (or vice versa)","Ensure files imported with ESM import syntax do not themselves use module.exports"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}