Comments (4)
Thanks for responding @eavichay .
For anyone else who comes across this, the polyfill did not resolve this specific problem (although it will be needed for older browsers). I was getting the above error in browsers that support the web components specification.
In order to use the latest slim-js
in a project using @babel/preset-env
, I needed to include it in the code transpiled through Babel and specifically call out the configuration in the rule options:
webpack.config.js
:
// module.rules
{
test: /\.js$/,
exclude: /(node_modules(?!\/slim-js\/))/,
use: {
loader: 'babel-loader',
options: {
configFile: path.join(__dirname, '.babelrc')
}
}
}
Since this fixes the eerror, I'll close this issue. Thanks again! 😄
from slim.js.
All web components suffer from this, native or via library.
Please refer to https://github.com/slimjs/slim-webpack-boilerplate. The babel config file uses class properties plug-in and in index.html the web components polyfill is loaded.
Unfortunately with babel transpiled to es5 you must use the polyfill.
from slim.js.
If you are addressing modern browsers that support custom elements without polyfill, then you may want to ditch babel. Consider working with rollup targeted as es6 modules.
from slim.js.
If you wish to start fresh PWA project based on slim-js, with typescript support (optional), sass/HTML/image loading via import, type npm init slimjs myProjectFolder
from slim.js.
Related Issues (20)
- package.json.module is pointing to an unexisting file HOT 1
- Storybook components HOT 2
- Typing for attributeChangedCallback lacks parameters HOT 1
- WEBP Support HOT 3
- s:if Conditional rendering not working HOT 9
- [SUGGESTION] Provide a way to take outter css in the shadowDOM HOT 2
- Non-minified package distribution HOT 1
- if directive inside foreach directive HOT 3
- Idea for cleaner templates HOT 1
- Unresponsive counter component HOT 2
- Documentation Site - "Oops, this page does not exists" HOT 1
- How does the property directive work? HOT 11
- Query in template css class name does not work in object usage only in object creation HOT 1
- Issue with Webpack exports
- How to setup vscode with `/*html*/` and typings HOT 2
- Links broken on slimjs.org HOT 1
- What is the point of this library? HOT 1
- Is this repo still active? HOT 2
- How to use the CDN?
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 slim.js.