Comments (2)
This is due to the namespace import, use a default import instead.
- import * as localforage from 'localforage';
+ import localforage from 'localforage';
More information about this can be found evanw/esbuild#532
from angular.
Thanks for the quick response!
It's good to see that JavaScript bundlers/compliers are trying to handle code consistently
Initially when making the update to my application I was getting an error telling me to enable allowSyntheticDefaultImports
so I thought I would check how my tsconfig.json was different to what is created for a new 17.3.5 application and found that newly created applications have esModuleInterop
set to true (which also enables allowSyntheticDefaultImports
) whereas mine did not.
After reading https://www.typescriptlang.org/tsconfig/#esModuleInterop there is a note at the bottom which I think helps explain the issue I had encountered:
Note: The namespace import
import * as fs from "fs"
only accounts for properties which are owned (basically properties set on the object and not via the prototype chain) on the imported object. If the module youβre importing defines its API using inherited properties, you need to use the default import form (import fs from "fs"
), or disable esModuleInterop.
The config
and createInstance
methods of localForage must only exist in the prototype and are not owned methods which is why setItem
and getItem
(which I assume are owned methods) were working and they were not.
from angular.
Related Issues (20)
- Angular 17 SSR: Slow server response time when using wildcard route HOT 5
- ERROR LOADING PAGES AFTER USE router.navigate
- SSR fails when root AppComponent in index.html is self-closing HOT 1
- foo = signal(''): if string is empty, !!foo () returns false HOT 1
- Form input mask provided by the framework HOT 6
- [Feature] Introduce Type-safe Token Providing HOT 7
- docs: `inject()` is missing all overloads HOT 2
- Add distinction between model() and model.required() on type level HOT 1
- Standalone Component Exports HOT 1
- Set ViewEncapsulation per module HOT 2
- setting signal outside of angular zone error HOT 3
- View provider/provider info that's logged in the console is incorrect
- No more subclasses or `implements`/`extends` information in API doc
- Missing code blocks in usage notes. HOT 1
- toSignal does not change if new published value passes equality check and there is no way to modify that HOT 2
- ErrorNG8001 ${element} is not know element HOT 11
- FormGroup.reset() input typings are incorrect HOT 2
- ErrorHandler docs don't have standalone alternative HOT 2
- Allow one time binding input HOT 1
- Missing example code for accessibility best practices case study HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular.