Skip to content

3.0.0-alpha.4 and 5 do not support component based import in TS #1283

Description

@toofishes

This code used to work to do a slimmer component-based version of rollbar (#1091), last known working in 3.0.0-alpha.2:

import Rollbar from 'rollbar/src/browser/core'
import telemeter from 'rollbar/src/telemetry'
import instrumenter from 'rollbar/src/browser/telemetry'
import scrub from 'rollbar/src/scrub'
import truncation from 'rollbar/src/truncation'

Rollbar.setComponents({
  telemeter,
  instrumenter,
  scrub,
  truncation,
})

But as of alpha.4 and alpha.5, it does not work - the below is with the latest alpha.5 release, even after #1272:

% npm run compile

> compile
> vue-tsc --noEmit

lib/rollbar.ts:1:21 - error TS2307: Cannot find module 'rollbar/src/browser/core' or its corresponding type declarations.

1 import Rollbar from 'rollbar/src/browser/core.js'
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/rollbar.ts:2:23 - error TS2307: Cannot find module 'rollbar/src/telemetry' or its corresponding type declarations.

2 import telemeter from 'rollbar/src/telemetry'
                        ~~~~~~~~~~~~~~~~~~~~~~~

lib/rollbar.ts:3:26 - error TS2307: Cannot find module 'rollbar/src/browser/telemetry' or its corresponding type declarations.

3 import instrumenter from 'rollbar/src/browser/telemetry'
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/rollbar.ts:4:19 - error TS2307: Cannot find module 'rollbar/src/scrub' or its corresponding type declarations.

4 import scrub from 'rollbar/src/scrub'
                    ~~~~~~~~~~~~~~~~~~~

lib/rollbar.ts:5:24 - error TS2307: Cannot find module 'rollbar/src/truncation' or its corresponding type declarations.

5 import truncation from 'rollbar/src/truncation'
                         ~~~~~~~~~~~~~~~~~~~~~~~~

Found 5 errors in the same file, starting at: lib/rollbar.ts:1

None of the examples in this repo seem to show the component-based strategy, so I'm thinking it hasn't actually been tested "from the outside", where the switch to a module-based package broke something.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

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