express-labs / pure-react-carousel

A highly impartial suite of React components that can be assembled by the consumer to create a carousel with almost no limits on DOM structure or CSS styles. If you're tired of fighting some other developer's CSS and DOM structure, this carousel is for you.

Home Page:https://express-labs.github.io/pure-react-carousel/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deployments fail when using Preact

Lauro235 opened this issue · comments

The problem

When deploying an Astro site to Vercel whilst using Preact and Preact/compat, the deployment fails with a note:

Error: Cannot find module 'react'
Require stack:
- /vercel/path0/node_modules/pure-react-carousel/dist/index.cjs.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)

The line of code that is presumably causing the deployment problems is this one?

  var React=_interopDefault(require("react"))

I'm using Preact and I believe I have the settings set correctly in the Astro config file.

// ... 
import preact from '@astrojs/preact';

export default defineConfig({
  integrations: [
      // ....
      preact({ compat: true }),
  ],
  vite: {
    resolve: {
      alias: {
        '~': path.resolve(__dirname, './src'),
      },
    },
  },
});

Describe the feature you'd like:

It would be really amazing if you could provide support for React alternatives like Preact. This allows Developers to keep there dependencies as low as possible.

Suggested implementation:

Unfortunately I wouldn't be able to provide any advice as to how to implement this!

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

commented

This issue has been automatically closed becuase it has not had recent activity.