Comments (17)
The fix for npm run generate
not running properly was a part of today's v4.17.1 release. If you're experiencing this bug on v4.17.0, please upgrade to v4.17.1.
from stencil.
Yes. you are right!!! sincerely thanks!!!!
from stencil.
Hey @MaybeSomeone 👋
Thanks for the error report! Can you do me a favor and provide some additional details for us?
- Can you make your reproduction URL public? I can't seem to access it
- Can you tell us what Operating System you're using, version of Node, and the output of
npx stencil info
?
Thanks!
from stencil.
Hello i have provide the url, but i just init project by export web component use, and then i execute npm run generate.
from stencil.
System: node 21.7.1
Platform: darwin (21.6.0)
CPU Model: Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz (8 cpus)
Compiler: /Users/super/Desktop/WebComponents/weathercomponent/node_modules/@stencil/core/compiler/stencil.js
Build: 1713808785
Stencil: 4.17.0 ♨️
TypeScript: 5.4.5
Rollup: 2.56.3
Parse5: 7.1.2
jQuery: 4.0.0-pre
Terser: 5.30.3
from stencil.
Thanks! I wasn't able to quite replicate it, but I think I know what's happening here. I see npm run generate
in the component starter just failing on my end (no error, no warning). I think I have a solution - could you try installing this dev build and let me know if it fixes it for you?
npm i @stencil/[email protected]
from stencil.
Ok i'll try and i change for another macbook can replicate it.
from stencil.
Hello how can i generate target component? it need me input the Component tag name, but export no relative components.
from stencil.
I don't know how to choose the target component or export all exist components.
from stencil.
You can generate a component with
npm run generate new-component
and select any css/test files to be generated.
I'm not sure I understand this part:
export no relative components.
from stencil.
yes i have, but seems absolutely a new components different with that exist component.tsx file.
from stencil.
Can you let me know how they differ?
from stencil.
generate code
import { Component, Host, h } from '@stencil/core';
@Component({
tag: 'component-set',
styleUrl: 'component-set.css',
shadow: true,
})
export class ComponentSet {
render() {
return (
<Host>
<slot></slot>
</Host>
);
}
}
origin
import { Component, Prop, h } from '@stencil/core';
import { format } from '../../utils/utils';
@Component({
tag: 'my-component',
styleUrl: 'my-component.css',
shadow: true,
})
export class MyComponent {
/**
* The first name
*/
@Prop() first: string;
/**
* The middle name
*/
@Prop() middle: string;
/**
* The last name
*/
@Prop() last: string;
private getText(): string {
return format(this.first, this.middle, this.last);
}
render() {
return <div>Hello, World! I'm {this.getText()}</div>;
}
}
from stencil.
That is the expected output for the generate
command - were you expecting something different?
from stencil.
i want generate a WebComponent can be use in html directly.
from stencil.
ok. i check the document i think i misunderstood...........
from stencil.
Okay, I understand now. Thanks! Stencil's generate
command does not generate a web component to use in HTML directly - you have to run the build command (npm run build
in the component starter, or npx stencil build
) in order to compile the TSX file to JS
from stencil.
Related Issues (20)
- bug: cannot get value of inherited custom CSS prop in a shadow DOM element via `E2EElement` APIs HOT 2
- bug: generated filename is too long HOT 2
- bug: missing root element's scope id as classname in nested child HOT 4
- bug: Failing to load a nested component hides all parents HOT 1
- bug: child input element is receiving un-wanted props HOT 11
- bug: watchIgnoredRegex is not respected during `stencil build --watch`
- bug: puppeteer: piercing on level 1 breaks HOT 8
- bug: `autofocus` prop/attr is defined on other HTML attribute types instead of `HTMLAttributes` HOT 2
- bug: HOT 6
- bug: missing root element's scope id as classname in user provided children HOT 2
- Attribute ping is missing on AnchorHTMLAttributes HOT 3
- bug: Cannot read properties of undefined (reading 'isProxied') HOT 2
- bug: Stencil v4.18.1 breaks support for Jest v26 HOT 7
- bug: intermediate parents' scope ids are not reflected to the children elements
- bug: Removing polyfills except for es5 builds breaks existing installs HOT 10
- bug: __mocks__ copied to output target HOT 3
- bug: Cannot access uninitialized variable, only in Safari, works with dev build HOT 3
- bug: Last version 4.18.2 breaks unit test in the proyect. HOT 4
- bug: Test files copied to output target HOT 6
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 stencil.