import projection from @arcgis/core

637
2
Jump to solution
02-24-2021 01:03 AM
ClémentLaskar
New Contributor III

Hi,

I'm having a hard time figuring how to import "projection" from "@arcgis/core"

I've installed it and then I try to import it in my React js app with

import projection from '@arcgis/core/geometry/projection'

 But I get an error message :

Attempted import error: '@arcgis/core/geometry/projection' does not contain a default export (imported as 'projection').

I don't know how to resolve the thing, when going to "projection.d.ts" there was a line

export = projection

That I tried to correct to

export default projection;

But it changed nothing and I'm not really aware of ts yet.

Thanks for your replies !

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Frequent Contributor II

Try this

import * as projection from '@arcgis/core/geometry/projection'
// or
import { load, project } from '@arcgis/core/geometry/projection'

View solution in original post

0 Kudos
2 Replies
ReneRubalcava
Frequent Contributor II

Try this

import * as projection from '@arcgis/core/geometry/projection'
// or
import { load, project } from '@arcgis/core/geometry/projection'
0 Kudos
ClémentLaskar
New Contributor III

Well thanks ! I thought I had to import projection...

0 Kudos