fullstorydev / fullstory-browser-sdk

Official FullStory SDK for JavaScript, for web browsers
MIT License
55 stars 17 forks source link

Usage with Rollup and Typescript #34

Closed scefali closed 4 years ago

scefali commented 4 years ago

I started converting the Sentry-FullStory integration into TS and I encountered this error

$ tsc src/index.ts && rollup -c
src/SentryFullStory.ts:3:8 - error TS1192: Module '"/Users/scefali/Work/sentry-fullstory/node_modules/@fullstorydev/browser/dist/index"' has no default export.

3 import FullStory from '@fullstorydev/browser';

Importing as such:

import FullStory from '@fullstorydev/browser';

EDIT:

I think changing the import is a workaround:

import * as FullStory from '@fullstorydev/browser';
patrick-fs commented 4 years ago

We'll make an update to address this. Right now, JS and TS clients import the API in two different ways:

JS ==> import FullStory from '@fullstorydev/browser'

TS ==> import * as FullStory from '@fullstorydev/browser'

Will make sure we provide a consistent interface.

patrick-fs commented 4 years ago

@scefali the latest version (2.0.0) of the @fullstorydev/browser package should fix this issue - please verify.