question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CmpApiModel missing in index.ts

See original GitHub issue

Version 1.5.5

Module (cmpapi, cli, stub, or testing) cmpapi

Describe with reproduction steps – What is the expected behavior? Unresolved dependencies

When i change the CmpApiModel path (used with version 1.3.0) from

import { CmpApiModel } from '@iabtcf/cmpapi/lib/CmpApiModel'; to import { CmpApiModel } from "@iabtcf/cmpapi/lib/mjs/CmpApiModel";

then there are warnings from rollupjs module bundler (!) Plugin node-resolve: Could not resolve import "@iabtcf/cmpapi/lib/mjs/CmpApiModel"

and webpack Module not found: Error: Package path ./lib/mjs/CmpApiModel is not exported from package /Users/john/workspace/example/node_modules/@iabtcf/cmpapi (see exports field in /Users/john/workspace/example/node_modules/@iabtcf/cmpapi/package.json)

Is there a reason why the class is not exported? Is it possible to add CmpApiModel to the index.ts?

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
shortaflipcommented, Dec 2, 2022

@sewolf ok, so this is what we will do then. I will merge in the PR that Marco created and a pre-release version of the library will contain those changes. Unfortunately, I won’t be able to have those changes into an actual release until near the beginning of January. I am the only one who manages the library and I will be going on vacation soon.

So you will just be including @iabtcf/cmpapi@next into your project. Come the new year, I will tag you in a comment in this ticket when the actual release is made.

1reaction
shortaflipcommented, Nov 29, 2022

@Marco-Prontera, thanks for the quick response but I’d like to hold off on merging that PR.

@sewolf, we need a bit more information. I can see that CmpApiModel.ts is available in the node_modules folder in the exact path that you specified for both common js and ESM. It may not be declared in index.ts but it is still an exported class. I was able to run it locally and build with no issues.

Screen Shot 2022-11-29 at 9 53 12 AM

Are you getting this error when you are running a dev server locally or when you are building? Have you tried importing as follows import { CmpApiModel } from '@iabtcf/cmpapi/lib/mjs/CmpApiModel.js'?

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular - Index.ts is missing from the TypeScript compilation ...
The missing file seems to be part of a third party library. TS files ... After removing index.ts , angular will use valid...
Read more >
index.ts is missing from the TypeScript compilation · Issue #7768
Description When trying to consume a module generated by the Swagger-codegen typescript-angular for version 4.3 in a angular 5 project ng ...
Read more >
Bug: index.d.ts is missing from the @zoomus/websdk package
Description The index.d.ts file does not get packed into the @zoomus/websdk package that's published to NPM. Since the file does actually ...
Read more >
ts is missing from the TypeScript compilation. - Shadi Atawneh
Error: C:WebApp\ClientApp\src\app\components\comonentname\model.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the ' ...
Read more >
on building my VS application, I'm getting in index.t.ts file
On Building the Visual Studio application, I'm getting below list of errors. Appreciate if someone could help me with some solution.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found