Export 'default' (imported as 'tt') was not found in '@tomtom-international/web-sdk-services

I get the following error when I try to use
@tomtom-international/web-sdk-services (5.60.0)
in my angular 9 project
I use
import tt from ‘@tomtom-international/web-sdk-services’;
key: ‘mykey’,
query: ‘Amsterdam, The Netherlands’,
and at the compiler I get the following error
export ‘default’ (imported as ‘tt’) was not found in '@tomtom-international/web-sdk-services

I’ve just tried to use Geocoding with Angular and it worked…

Can show some more of your code?

1 Like

I had a project that is running fine. I created 3 new empty projects to test it with angular 8, 9, 10 and it is working fine.
I am trying to adopt it in another project that is quite big and it fails with this error. I tried also 2-3 past versions and the beta version and it is still doing it. The problem is that the project that I am adding it is quite big to start it over… it is a one year work.
In case it helps when I use
const tt = require(’@tomtom-international/web-sdk-services’);
it compiles but then the tt.services is undefined to use it
So it sounds like there is a parameter or a conflict that is causing it. I hope that I can fix it else if I quit tomtom I would have to remove it from my other project too that I am using it in production!
Thank you in advance

Are you also using maps in this project or only the services lib?

only the services like my other project.
I use open layer maps for displaying maps and tomtom for geocoding.
I also have the same open layer maps plugin to my other project that is working fine. I also installed it in the test projects that I mentioned and it was still working fine with tomtom

can you try with the full path?

import tt from 'node_modules/@tomtom-international/web-sdk-services';

"export ‘default’ (imported as ‘tt’) was not found in ‘node_modules/@tomtom-international/web-sdk-services’

Can you check if the file services.min.js exists and has any content? Or maybe try to compare it with a copy from other app.

yes it has content. I have also tried to overwrite all tomtom files from my working project but it still didn’t work. Although I had noticed differences in the directory structure in case it helps
working project has in node_modules
@tomtom-international\web-sdk-services\node_modules the following folders
core-js, regenerator-runtime, whatwg-fetch

the non working project has the following folders
core-js, lodash, regenerator-runtime

Does putting tt in curly brackets change anything?

import { tt } from '@tomtom-international/web-sdk-services';

or other guess from the team

import * as tt from '@tomtom-international/web-sdk-services'

I just tried both but neither one worked