Giter VIP home page Giter VIP logo

Comments (17)

rwaskiewicz avatar rwaskiewicz commented on May 24, 2024 2

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.

MaybeSomeone avatar MaybeSomeone commented on May 24, 2024 1

Yes. you are right!!! sincerely thanks!!!!

from stencil.

rwaskiewicz avatar rwaskiewicz commented on May 24, 2024

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.

MaybeSomeone avatar MaybeSomeone commented on May 24, 2024

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.

MaybeSomeone avatar MaybeSomeone commented on May 24, 2024

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.

rwaskiewicz avatar rwaskiewicz commented on May 24, 2024

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.

MaybeSomeone avatar MaybeSomeone commented on May 24, 2024

Ok i'll try and i change for another macbook can replicate it.

from stencil.

MaybeSomeone avatar MaybeSomeone commented on May 24, 2024

Hello how can i generate target component? it need me input the Component tag name, but export no relative components.

from stencil.

MaybeSomeone avatar MaybeSomeone commented on May 24, 2024

I don't know how to choose the target component or export all exist components.

from stencil.

rwaskiewicz avatar rwaskiewicz commented on May 24, 2024

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.

MaybeSomeone avatar MaybeSomeone commented on May 24, 2024

yes i have, but seems absolutely a new components different with that exist component.tsx file.

from stencil.

rwaskiewicz avatar rwaskiewicz commented on May 24, 2024

Can you let me know how they differ?

from stencil.

MaybeSomeone avatar MaybeSomeone commented on May 24, 2024

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.

rwaskiewicz avatar rwaskiewicz commented on May 24, 2024

That is the expected output for the generate command - were you expecting something different?

from stencil.

MaybeSomeone avatar MaybeSomeone commented on May 24, 2024

i want generate a WebComponent can be use in html directly.

from stencil.

MaybeSomeone avatar MaybeSomeone commented on May 24, 2024

ok. i check the document i think i misunderstood...........

from stencil.

rwaskiewicz avatar rwaskiewicz commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.