Skip to content

testing parallel builds #1202

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

GoldGroove06
Copy link
Collaborator

@GoldGroove06 GoldGroove06 commented Jul 10, 2025

Summary by CodeRabbit

  • Chores
    • Improved the build workflow with a multi-stage pipeline, enabling parallel CSS and component builds for faster and clearer processing.
    • Updated build tools and configuration for improved bundling and transpilation using esbuild and Rollup enhancements.
    • Cleaned up code imports for better maintainability.

Copy link
Contributor

coderabbitai bot commented Jul 10, 2025

Warning

Rate limit exceeded

@GoldGroove06 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 49 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between b01e66c and 403d164.

📒 Files selected for processing (1)
  • rollup.config.cjs (2 hunks)
## Walkthrough

The GitHub Actions workflow for the RAD UI project was refactored from a single build job into a multi-stage pipeline. The new workflow introduces separate jobs for setup, testing, CSS building, and component building, with explicit dependencies and parallel execution for the build steps. The final build job now only outputs a completion message.

## Changes

| File(s)                                   | Change Summary                                                                                   |
|-------------------------------------------|------------------------------------------------------------------------------------------------|
| .github/workflows/build-rad-ui.yml        | Refactored workflow: split single build job into `setup`, `test`, `build_css`, `build_components`, and a final `build` job; added job dependencies, parallelization, and explicit permissions. |
| package.json                              | Added `esbuild` and `rollup-plugin-esbuild` as new devDependencies for enhanced build tooling. |
| rollup.config.cjs                         | Rewrote Rollup config: replaced per-component builds with a single multi-entry build; replaced Babel/TypeScript plugins with `rollup-plugin-esbuild`; added PostCSS; simplified externals; updated banner plugin. |
| src/components/ui/Accordion/fragments/AccordionRoot.tsx | Removed unused `useState` import from React.                                                    |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant GitHub Actions
    participant Setup Job
    participant Test Job
    participant Build CSS Job
    participant Build Components Job
    participant Final Build Job

    GitHub Actions->>Setup Job: Start setup (checkout, Node.js, npm ci)
    Setup Job-->>Test Job: On success, trigger test
    Test Job->>Test Job: Run tests (checkout, Node.js, npm ci, npm test)
    Test Job-->>Build CSS Job: On success, trigger build_css
    Test Job-->>Build Components Job: On success, trigger build_components
    Build CSS Job->>Build CSS Job: Build CSS (checkout, Node.js, npm ci, clean, build CSS)
    Build Components Job->>Build Components Job: Build components (checkout, Node.js, npm ci, clean, build components)
    Build CSS Job-->>Final Build Job: On success, notify build
    Build Components Job-->>Final Build Job: On success, notify build
    Final Build Job->>Final Build Job: Output completion message

Suggested labels

automerge

Suggested reviewers

  • kotAPI

Poem

🐇
Hopped through the pipeline, jobs split with care,
Setup and testing now float in the air.
CSS and components build side by side,
In parallel lanes, they swiftly glide.
At the finish, a message so neat—
RAD UI’s build is now complete!


<!-- walkthrough_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEejqANiS41E4jER5oqFqxcgDs8C7UQGActjMApRcAIwATAAMEQYAqoihkADi+D7JFPj4UlEAbEb6xuBQZPT4AGY4BMRkyjT0TKzsXLz8wqLiUjLyTEpUqupaOoUmUHCoqJhVhKTkVPUKTRickFQA7pCIQczO8nIKfSpqmtq6YIZFpgYaROqw2AIA9Gv4FADW5Rb4a4iPnt60MBUQFeDSyZgWDgGABEsIMAGJ4ZAAIIASRqc2odE2212/EqDFgmFIfgMcBIKXUAAkHiixPB8BhkC93p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5hHKaAphtA5QJAYQYQAAnAwE4WgAABy0CRBuERARAMBGFOG5DuFGFRAMBBJnCGAcG9TuFBKxZhDuHuFoB+HlAGG0BRBGFeFBJoBRACBhCpEBFRCeECBBIkARAkDuFOGFERF6EQAeCWEkC5C5AMAAAsJAJAAgrRwRwSvhQSDA7hRyjR7hzRqREQ7hEQuQEQtAIRYQTUuhchLAW0uAihvgKh109MGhTEwk+gQAA= -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=rad-ui/ui&utm_content=1202):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (3)
.github/workflows/build-rad-ui.yml (3)

29-42: Testing job still duplicates checkout / node setup

If you keep the current structure, you can speed things up by re-using the workspace from setup via uses: actions/upload-artifact / download-artifact rather than repeating the same three steps.

Example sketch:

# in setup
- name: Package workspace
  uses: actions/upload-artifact@v4
  with:
    name: workspace
    path: |
      node_modules
      .npmrc

# in test / build_* jobs
- name: Restore workspace
  uses: actions/download-artifact@v4
  with:
    name: workspace

This keeps the pipeline parallelism while eliminating redundant work.


44-77: Consider merging build_css and build_components into a matrix job

Both jobs are structurally identical except for the final npm run build:* command.
Using a matrix with a single job definition cuts YAML noise and is easier to maintain:

  build_assets:
    runs-on: ubuntu-latest
    needs: test
    strategy:
      matrix:
        target: [css, components]
    steps:
      # …checkout / setup / install…
      - run: npm run build:${{ matrix.target }}

This preserves parallelism while reducing duplication.


80-83: Final build job does nothing actionable

The last job only echoes a message. If its sole purpose is to gate merge conditions, consider:

  • Renaming it to done or ci to make intent clearer.
  • Removing it entirely and instead relying on required-status checks for build_css and build_components.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b9e9699 and 73551c0.

📒 Files selected for processing (1)
  • .github/workflows/build-rad-ui.yml (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: kotAPI
PR: rad-ui/ui#640
File: .github/workflows/build-rad-ui.yml:5-5
Timestamp: 2024-12-14T02:25:41.034Z
Learning: In the `rad-ui/ui` repository, the `security-fixes` branch only updates dependencies, so linting and Chromatic workflows are not required for this branch.
.github/workflows/build-rad-ui.yml (1)
Learnt from: kotAPI
PR: rad-ui/ui#640
File: .github/workflows/build-rad-ui.yml:5-5
Timestamp: 2024-12-14T02:25:41.034Z
Learning: In the `rad-ui/ui` repository, the `security-fixes` branch only updates dependencies, so linting and Chromatic workflows are not required for this branch.
🪛 actionlint (1.7.7)
.github/workflows/build-rad-ui.yml

18-18: property "cache" is not defined in object type {}

(expression)

Comment on lines +20 to +27
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

npm ci repeated in every job – burns minutes and cache storage

Each downstream job re-installs dependencies even though setup already did so.
Instead, cache node_modules (with actions/cache) or upload them as an artifact in setup and download in dependent jobs. This will shave several minutes from every run.

🤖 Prompt for AI Agents
In .github/workflows/build-rad-ui.yml around lines 20 to 27, the workflow runs
`npm ci` in every job, causing redundant dependency installations and wasting
time and cache storage. To fix this, remove the repeated `npm ci` commands from
downstream jobs and instead cache the `node_modules` directory using
`actions/cache` or upload `node_modules` as an artifact in the setup job and
download it in dependent jobs. This will reuse installed dependencies and speed
up the workflow.

Comment on lines +17 to +25
outputs:
node-modules-cache: ${{ steps.cache.outputs.cache-hit }}
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Broken outputs reference – workflow will fail at runtime

steps.cache.outputs.cache-hit points to a step ID that doesn’t exist.
Because the actions/setup-node step has no id, the expression resolves to null and the whole job definition is syntactically invalid – GitHub Actions will refuse to run the workflow.

Fix by either (a) removing the unnecessary custom output or (b) giving the setup-node step an id and referencing that:

-    outputs:
-      node-modules-cache: ${{ steps.cache.outputs.cache-hit }}
+    outputs:
+      node-modules-cache: ${{ steps.setup-node.outputs.cache-hit }}

-      - name: Setup Node.js
-        uses: actions/setup-node@v4
+      - name: Setup Node.js
+        id: setup-node
+        uses: actions/setup-node@v4

Without this change the whole workflow is dead-on-arrival.

🧰 Tools
🪛 actionlint (1.7.7)

18-18: property "cache" is not defined in object type {}

(expression)

🤖 Prompt for AI Agents
In .github/workflows/build-rad-ui.yml around lines 17 to 25, the outputs section
references steps.cache.outputs.cache-hit, but there is no step with the ID
"cache" defined, causing the workflow to fail. Fix this by either removing the
outputs section if it is unnecessary or by adding an id: cache to the setup-node
step and ensuring the output reference matches that id. This will make the
output reference valid and prevent the workflow from being syntactically
invalid.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
rollup.config.cjs (1)

37-46: Consider using either esbuild or terser for minification, not both.

The configuration has minify: false in esbuild settings but then adds the terser plugin. This creates redundant processing.

For better performance, choose one approach:

Option 1: Use esbuild's built-in minification (faster)

     esbuild({
       include: /\.[jt]sx?$/,
       exclude: /node_modules/,
       sourceMap: true,
-      minify: false,
+      minify: true,
       target: 'esnext',
       jsx: 'automatic',
       tsconfig: 'tsconfig.json',
     }),
-    terser(),

Option 2: Keep terser for more aggressive optimization
Keep the current setup if terser provides better minification for your use case.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 73551c0 and ad85ba1.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • package.json (2 hunks)
  • rollup.config.cjs (1 hunks)
  • src/components/ui/Accordion/fragments/AccordionRoot.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/components/ui/Accordion/fragments/AccordionRoot.tsx
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: kotAPI
PR: rad-ui/ui#640
File: .github/workflows/build-rad-ui.yml:5-5
Timestamp: 2024-12-14T02:25:41.034Z
Learning: In the `rad-ui/ui` repository, the `security-fixes` branch only updates dependencies, so linting and Chromatic workflows are not required for this branch.
🪛 Biome (1.9.4)
rollup.config.cjs

[error] 1-1: Illegal use of an import declaration outside of a module

not allowed inside scripts

(parse)


[error] 1-2: Illegal use of an import declaration outside of a module

not allowed inside scripts

(parse)


[error] 2-3: Illegal use of an import declaration outside of a module

not allowed inside scripts

(parse)


[error] 3-4: Illegal use of an import declaration outside of a module

not allowed inside scripts

(parse)


[error] 4-5: Illegal use of an import declaration outside of a module

not allowed inside scripts

(parse)


[error] 5-6: Illegal use of an import declaration outside of a module

not allowed inside scripts

(parse)


[error] 6-7: Illegal use of an import declaration outside of a module

not allowed inside scripts

(parse)


[error] 7-8: Illegal use of an import declaration outside of a module

not allowed inside scripts

(parse)


[error] 14-50: Illegal use of an export declaration outside of a module

not allowed inside scripts

(parse)

🔇 Additional comments (1)
package.json (1)

109-109: LGTM! Build dependencies added correctly.

The addition of esbuild and rollup-plugin-esbuild as development dependencies aligns with the rollup configuration refactoring to use esbuild for transpilation.

Also applies to: 126-126

Comment on lines 10 to 13
// Auto-generate entry points from `src/components` (if needed)
const componentFiles = readdirSync('src/components')
.filter(f => f.endsWith('.tsx') || f.endsWith('.ts'))
.map(f => `src/components/${f}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify: Component discovery only reads root-level files.

The new configuration only discovers .ts and .tsx files directly under src/components/, not in nested directories. According to the AI summary, the previous configuration discovered components under src/components/ui/ subdirectories.

Is this change intentional? If components exist in subdirectories, they won't be built.


🏁 Script executed:

#!/bin/bash
# Description: Check if there are components in nested directories that might be missed

# Find all .tsx and .ts files under src/components, including subdirectories
echo "All TypeScript files under src/components:"
fd -e tsx -e ts . src/components --type f | sort

# Check specifically for the ui subdirectory mentioned in the summary
echo -e "\nChecking for src/components/ui directory:"
if [ -d "src/components/ui" ]; then
    echo "ui subdirectory exists. Files:"
    fd -e tsx -e ts . src/components/ui --type f | sort
else
    echo "No ui subdirectory found"
fi

# Compare with what the current config would capture
echo -e "\nFiles the current config would capture:"
ls src/components/*.{ts,tsx} 2>/dev/null || echo "No root-level .ts/.tsx files found"

Length of output: 24744


Fix component discovery to include nested directories

The current logic in rollup.config.cjs (lines 10–13) only reads files directly under src/components, so it discovers nothing—the entire codebase lives in subfolders (e.g. src/components/ui/** and src/components/tools/**).

This will prevent any components from being built. Update the entry-point generation to recurse into subdirectories. For example:

- const componentFiles = readdirSync('src/components')
-   .filter(f => f.endsWith('.tsx') || f.endsWith('.ts'))
-   .map(f => `src/components/${f}`);
+ import glob from 'glob';
+
+ // Auto-generate entry points from all .ts/.tsx files under src/components
+ const componentFiles = glob
+   .sync('src/components/**/*.@(ts|tsx)')
+   .map(path => path);

Points to address:

  • rollup.config.cjs: replace readdirSync logic with a recursive glob (or equivalent).
  • Ensure new dependency (e.g. glob) is installed or use a built-in solution.
  • Confirm that entry points now include all nested component files.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In rollup.config.cjs around lines 10 to 13, the current component file discovery
only reads files directly under src/components and misses nested directories.
Replace the readdirSync logic with a recursive file search using a glob pattern
or equivalent to include all .ts and .tsx files in subdirectories. If using a
new dependency like glob, ensure it is installed and imported properly. Verify
that the updated entry points array includes all nested component files under
src/components.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (2)
rollup.config.cjs (2)

1-9: Critical: ES module syntax in CommonJS file will cause runtime errors.

This issue was previously identified but still exists. The file uses ES module syntax (import) but has a .cjs extension indicating CommonJS, which will fail at runtime.


11-14: Fix component discovery to include nested directories.

This issue was previously identified but still exists. The current logic only reads files directly under src/components, missing all nested directories where components actually exist.

🧹 Nitpick comments (1)
rollup.config.cjs (1)

4-4: Simplify the esbuild plugin initialization.

The fallback pattern esbuild.default || esbuild is unusual and likely unnecessary. Consider using a standard import approach.

-const esbuildPlugin = esbuild.default || esbuild;

Then use esbuild directly on line 38:

-    esbuildPlugin({
+    esbuild({
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ad85ba1 and b01e66c.

📒 Files selected for processing (1)
  • rollup.config.cjs (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: kotAPI
PR: rad-ui/ui#640
File: .github/workflows/build-rad-ui.yml:5-5
Timestamp: 2024-12-14T02:25:41.034Z
Learning: In the `rad-ui/ui` repository, the `security-fixes` branch only updates dependencies, so linting and Chromatic workflows are not required for this branch.
rollup.config.cjs (1)
Learnt from: decipher-cs
PR: rad-ui/ui#417
File: src/components/ui/Dropdown/Dropdown.stories.tsx:43-50
Timestamp: 2024-12-12T08:34:33.079Z
Learning: Ensure to verify existing ARIA attributes in components before suggesting additions during code reviews, especially in the `Dropdown.Trigger` component in `src/components/ui/Dropdown/Dropdown.stories.tsx`.
🪛 Biome (1.9.4)
rollup.config.cjs

[error] 1-1: Illegal use of an import declaration outside of a module

not allowed inside scripts

(parse)


[error] 1-2: Illegal use of an import declaration outside of a module

not allowed inside scripts

(parse)


[error] 2-3: Illegal use of an import declaration outside of a module

not allowed inside scripts

(parse)


[error] 4-5: Illegal use of an import declaration outside of a module

not allowed inside scripts

(parse)


[error] 5-6: Illegal use of an import declaration outside of a module

not allowed inside scripts

(parse)


[error] 6-7: Illegal use of an import declaration outside of a module

not allowed inside scripts

(parse)


[error] 7-8: Illegal use of an import declaration outside of a module

not allowed inside scripts

(parse)


[error] 8-9: Illegal use of an import declaration outside of a module

not allowed inside scripts

(parse)


[error] 15-51: Illegal use of an export declaration outside of a module

not allowed inside scripts

(parse)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build_css
  • GitHub Check: build_components

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant