ionic-team / stencil-ds-output-targets

These are output targets that can be added to Stencil for React and Angular.
https://stenciljs.com
MIT License
250 stars 117 forks source link

bug: lib/components.ts(6,15): error TS2305: Module '"stencil-library"' has no exported member 'JSX'. #427

Open loremru opened 7 months ago

loremru commented 7 months ago

Prerequisites

Stencil Version

v4.15

Current Behavior

✖ vue-library:build

vue-library@0.0.0 build npm run tsc

vue-library@0.0.0 tsc tsc -p . --outDir ./dist

  lib/components.ts(6,15): error TS2305: Module '"stencil-library"' has no exported member 'JSX'.
  npm ERR! Lifecycle script `tsc` failed with error: 
  npm ERR! Error: command failed 
  npm ERR!   in workspace: vue-library@0.0.0 
  npm ERR!   at location: /Users/loremru/Desktop/work/mine/mj/mj-ds/packages/vue-library 
  npm ERR! Lifecycle script `build` failed with error: 
  npm ERR! Error: command failed 
  npm ERR!   in workspace: vue-library@0.0.0 
  npm ERR!   at location: /Users/loremru/Desktop/work/mine/mj/mj-ds/packages/vue-library 

Expected Behavior

build

System Info

System: node 18.16.0
    Platform: darwin (23.2.0)
   CPU Model: Apple M1 Pro (10 cpus)
    Compiler: /Users/loremru/Desktop/work/mine/mj/mj-ds/node_modules/@stencil/core/compiler/stencil.js
       Build: 1712585430
     Stencil: 4.15.0 🎖
  TypeScript: 5.4.4
      Rollup: 2.56.3
      Parse5: 7.1.2
      jQuery: 4.0.0-pre
      Terser: 5.30.0

Steps to Reproduce

follow docs with lerna https://stenciljs.com/docs/vue

Code Reproduction URL

https://github.com/loremru/stencil-bug-0

Additional Information

please improve docs and give template with lerna. Stencil defines as build-tool but haven't an example for building

tanner-reits commented 7 months ago

@loremru Transferred this issue over to the framework wrapper repo. At this time, the framework wrappers are only maintained to support the Ionic Framework, so we are not sure when this work will be prioritized. We welcome any community contributions if you'd like to take a stab at this yourself!

callistusasir commented 6 months ago

This worked to produce a successful build, add this to your index.ts file in your main stencil project and try and build it.

import { JSX } from './components'; // Replace with your relative directory

export { format } from './utils/utils';  // Replace with your relative directory

export { JSX }
venkatesh-nagineni commented 4 months ago

the workaround not working because this index.ts get's overwritten not include any types, inside dist/components there is index.d.ts file but this file not really generated from src folder index.ts

ionitron-bot[bot] commented 1 month ago

This issue has been labeled as help wanted. This label is added to issues that we believe would be good for contributors.

If you'd like to work on this issue, please comment here letting us know that you would like to submit a pull request for it. This helps us to keep track of the pull request and make sure there isn't duplicated effort. Thank you!