Skip to content

azure-maps-control fails to build in Turborepo Next.js monorepo: "Identifier 'e' has already been declared" #235

@khurs10101

Description

@khurs10101

When using azure-maps-control with Next.js 15.5.3 in a Turborepo monorepo, the build fails with the following error:

`Module parse failed: Identifier 'e' has already been declared (3644:109)
/node_modules/azure-maps-control/dist/atlas-esm.min.js

3644 | let [e, t, r, n] = param;
3645 | let i, o;

3646 | var a = ut((.2225045 * (e = ct(e)) + .7168786 * (t = ct(t)) + .0606169 * (r = ct(r))) / Qe), e = (e === t && t === r ? i = o = a : (i = ut(.4360747 * e + .3850649 * t + .1430804 * r) / Je), ...
`

This occurs as soon as the component imports:

import * as atlas from 'azure-maps-control';

Steps to Reproduce :

  • Create a Turborepo monorepo using create-turbo.
  • Add a Next.js app (next@15.5.3).
  • Install Azure Maps:

npm install azure-maps-control

Add a simple map component:

`import { useEffect, useRef } from 'react';
import * as atlas from 'azure-maps-control';

export default function Map() {
const ref = useRef(null);
useEffect(() => {
if (!ref.current) return;
new atlas.Map(ref.current, {
authOptions: {
authType: atlas.AuthenticationType.subscriptionKey,
subscriptionKey: process.env.NEXT_PUBLIC_AZURE_MAPS_KEY!,
},
});
}, []);
return <div ref={ref} style={{ height: 500 }} />;
}
`

Run npx next dev.

Expected behavior

The Azure Maps SDK should build and run without syntax errors under modern bundlers like Next.js Webpack/Turborepo.

Actual behavior

Webpack parsing fails on atlas-esm.min.js with the error above.

Screenshots

Environment

  • azure-maps-control: ^3.x.x (latest at time of report)
  • Next.js: 15.5.3
  • Turborepo: latest
  • Node.js: >=18
  • OS: Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions