Questions tagged [npm-package]
464 questions
5
votes
1 answer
How to publish js + assets files to npm
I've developed a small Ui component for internal use in a company and published it to npm but when I install that package I only get an index.js file in node_modules folder.
I'm not using any package builder, es-modules, just a straightforward .js…

Andrew
- 1,507
- 1
- 22
- 42
4
votes
1 answer
How to bundle many TypeScript declaration files into an npm package and import from index.d.ts?
I have an internal package with about the following structure:
myPackage/
|- types/
| |- type1.d.ts
| |- type2.d.ts
|- src/
| |- someUtilities.ts
|- index.ts
|- package.json
|- tsconfig.json
The index.ts is importing and exporting all the .d.ts…

zaplec
- 1,681
- 4
- 23
- 51
4
votes
1 answer
NPM. Paths for importing files from a package
Is it possible to customize the paths for importing files from a package?
I have a package, this is a UI kit for our internal project. Now after building using WebPack I have the following project structure:
- dist
- components
- index.d.ts
-…

Vlad
- 43
- 2
4
votes
2 answers
How can I fix the "Failed to parse source map from ..." errors in my ReactJS/TS project
I have a ReactJS project where I wanted to use a Barcode-Scanner npm module with the name html5-qrcode, but I always get this error:
Failed to parse source map from 'C:\...\node_modules\html5-qrcode\third_party\index.js.map' file: Error: ENOENT: no…

Cinc-B
- 121
- 2
- 9
4
votes
0 answers
How can I correctly export and import my .svg library that holds icons for UI and logos for companies? Is my tsconfig setup properly?
Overview:
I have a library of svg icons that I want to publish and I'm having either problems with the typescript types (There aren't any to export). I'm not entirely sure if I am exporting the .svg file since I'm just importing each file into…

jefelewis
- 1,850
- 1
- 27
- 63
4
votes
0 answers
Publishing with lerna after prerelease without using force-publish
we currently have the following workflow.
ticket comes in (eg. BRAND-1234)
we create a branch and work on the ticket and commit and push
for testing, we do then yarn lerna publish preminor --preid BRAND-1234
now other collegues can use…

Luke
- 8,235
- 3
- 22
- 36
4
votes
1 answer
NestJS/TypeORM: Can custom repository extend from another custom repository which is inside another project?
ERROR
RepositoryNotFoundError: No repository for "UserQueryRepository" was found. Looks like this entity is not registered in current "default" connection?
VERSION
@nestjs/typeorm - 7.1.5
@nestjs/common - 7.6.15
@nestjs/core - 7.6.15
nodejs -…

Narek Keryan
- 41
- 1
- 3
4
votes
2 answers
How to import npm package to a client file
I am trying to import the js-search npm package to my client .js file. Their docs says to write import * as JsSearch from 'js-search';, however, this gives me a Uncaught TypeError: Failed to resolve module specifier "js-search". Relative references…

Ryan Eom
- 337
- 3
- 14
4
votes
1 answer
Unable to bundle a Web Worker to be imported like an NPM package
My goal is to be able to publish a Web Worker NPM package which can be imported normally (import MyPkg from 'my-pkg') without requiring the user to import it with worker-loader (inline or otherwise)
To accomplish this, I've tried using a Babel build…

adamellsworth
- 361
- 1
- 3
- 15
3
votes
0 answers
How can i use web worker in npm packages?
I want to use web worker to develop a tool library in vite.
Use web worker to upload big file.
I use new URL for new Worker.
The slice-upload-utils project is running normally in other project by workspace:*,
but using it in other project by pnpm…

ywenhao
- 31
- 1
3
votes
0 answers
ng Serve suddenly giving Error: export 'ɵa' (imported as 'i8') was not found in error
I'm working on a local custom library. I've been testing locally by packing a tgz. I haven't had issues but now I get
Error: export 'ɵa' (imported as 'i8') was not found in 'ngx-filepond' (possible exports: FilePondComponent, FilePondModule,…

dcp3450
- 10,959
- 23
- 58
- 110
3
votes
1 answer
Using NPM packages with Rust and Webassembly
Is there a way to use npm packages inside Rust code along with webassembly? Right now using webpack, @wasm-tool/wasm-pack-plugin and wasm_bindgen crate that were already present in this template:…

Javed
- 460
- 4
- 15
3
votes
0 answers
Published styled-components UI library does not have access to extended theme types on the consumer side
I am creating UI library using styled-components. I am extending the DefaultTheme type to support custom themes that are needed for our use case. Both theme and theme definition is coming from a different internal package that I use. When working on…

Patrycja
- 31
- 2
3
votes
3 answers
Unexpected token '?' when trying to run 'npm run dev'
Can someone help me with this error
SyntaxError: Unexpected token '?'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js…

Hooy
- 31
- 1
- 2
3
votes
0 answers
Pinia lost reactivity when using it in library mode
i'm currently trying to create a library out of an existing project, that should export a component with a "flow" inside it (eg. Imagine the library as an iframe replace, so importing the library should give the possibility to import a component…

Ceereals
- 46
- 5