Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Assetpath does not work in react output directory #5999

Open
3 tasks done
muthupriyashanmugam opened this issue Sep 26, 2024 · 1 comment
Open
3 tasks done

bug: Assetpath does not work in react output directory #5999

muthupriyashanmugam opened this issue Sep 26, 2024 · 1 comment
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil Help Wanted

Comments

@muthupriyashanmugam
Copy link

Prerequisites

Stencil Version

4.18.3

Current Behavior

The assetDirs works well in stencil component where as try to check those component in react output, it does not work well.

The below code which i am using to copy the assetDir to the react folder. But the getAssetPath function does not work.

export const config: Config = {
  globalStyle: "src/global/global.css",
  extras: {
    experimentalSlotFixes: true,
    experimentalScopedSlotChanges: true,
  },
  namespace: "library",
  outputTargets: [
    {
      type: "dist",
      esmLoaderPath: "../loader",
      copy: [
        { src: "components/assets", dest: "build/assets" },
        { src: "components/assets", dest: "../esm/assets" },
        { src: "components/assets", dest: "../../../react-library/dist/build/assets" },
      ],
    },
    {
      type: "www",
      // serviceWorker: null, // disable service workers
      copy: [{ src: "components/assets", dest: "build/assets" }],
    },
    reactOutputTarget({
      componentCorePackage: "ai12z",
      proxiesFile: "../react-library/lib/components/stencil-generated/index.ts",
      includeDefineCustomElements: true,
    }),
  ],
  testing: {
    browserHeadless: "new",
  },
  devServer: {
    reloadStrategy: "pageReload",
  },
}
```

### Expected Behavior

The getAssetpath function should work in react component to retrieve the asset path directory.

### System Info

```shell
"@stencil/core": "^4.18.3",
"@stencil/react-output-target": "^0.5.3",
system : windows 11/ Dell
npm: "10.8.1"
```


### Steps to Reproduce

Copy the asset folder to the react folder and assessing the getAssetPath function in react component.

### Code Reproduction URL

https://github.com/muthupriyashanmugam/stencil-issue

### Additional Information

_No response_
@ionitron-bot ionitron-bot bot added the triage label Sep 26, 2024
@christian-bromann christian-bromann added Bug: Validated This PR or Issue is verified to be a bug within Stencil Help Wanted and removed triage labels Sep 30, 2024
@christian-bromann
Copy link
Member

@muthupriyashanmugam thanks for raising an issue and providing a reproducible example. Our team currently has a lot of competing priorities and we can't say when we are able to take a look at this. We would appreciate any support in form of investigation on the root cause or actual fixes. We are happy to answer any technical questions as they arise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil Help Wanted
Projects
None yet
Development

No branches or pull requests

2 participants