Skip to content

[Bug?]: Page components - weird behaviour with transpiling plugins (@danielx/civet example) #1549

Closed

Description

@IgorSzymanski

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

Page components (in /routes directory) don't get compiled using plugins configured in app.config.ts, unlike other components.

Expected behavior 🤔

Just like any other component, page components should be transpiled by application plugins.

Steps to reproduce 🕹

Steps:

  1. Create a new Solid Start application.
  2. Install @danielx/civet library.
  3. Setup config:
// app.config.ts

import civetVitePlugin from '@danielx/civet/vite'
import { defineConfig } from '@solidjs/start/config'

export default defineConfig({
  extensions: ['civet', 'tsx', 'ts'],
  vite: {
    plugins: [
      civetVitePlugin({
        ts: 'civet',
      }),
    ]
  }
});
  1. Create a civet page in /routes directory.
export default function Civet
  <>
    This is a Civet page.<br />
    This doesn't work.<br />
    This would be the perfect way to write Civet pages.

  1. Minimal reproduction repo: https://codesandbox.io/p/github/IgorSzymanski/solid-start-plugin-issue/civet-plugin

Context 🔦

This a minor issue, because there is a workaround, but the behaviour is very weird and inconsistent.
I use @danielx/civet/vite plugin to write my SolidJS application using Civet syntax (https://civet.dev/).

Civet is a programming language that compiles to TypeScript or JavaScript, so you can use existing tooling (including VSCode type checking, hints, completion, etc.) while enabling concise and powerful syntax. It starts with 99% JS/TS compatibility, making it easy to transition existing code bases.

Basically, the plugin actually works, as I can write Civet components (as seen in the reproduction repo) and they get transpiled to TS just fine. The only issue is that page components (or route components) get ignored and they're treated like they're just components written in TS. Perfectly, page components should get the same treatment that other components get and if they're written in Civet, they should be transpiled as well.

There is a workaround - I can just write .civet components, but stick to TS syntax in page components (which is still compatible with civet), co it's in no way a critical issue, but an inconvenience nevertheless.

I don't know the codebase of Solid Start, so I'm not sure what's causing the issue or what could potentially fix it.

Your environment 🌎

No response

Activity

  1. changed the title [-][Bug?]: Page components - weird behaviour with transpiling plugins[/-] [+][Bug?]: Page components - weird behaviour with transpiling plugins (`@danielx/civet` example)[/+] on Jun 16, 2024
  2. doeixd commented on Jun 18, 2024

    @doeixd
    Contributor

    I think this is a vinxi issue? I think the file is being processed by esbuild before being transformed by the civet plugin.

    @nksaraf

    https://github.com/nksaraf/vinxi/blob/a63eabd27a43af491772126a547a970f4bc7d484/packages/vinxi/lib/fs-router.js#L41

    https://github.com/nksaraf/vinxi/blob/a63eabd27a43af491772126a547a970f4bc7d484/packages/vinxi/lib/fs-router.js#L128

    Maybe solid start could transform the files first in their implementation of the FileSystem Router ? IDK.

    For now maybe you could check out: civetman it looks like it should work with the FileSystem router.

  3. IgorSzymanski commented on Jun 19, 2024

    @IgorSzymanski
    Author

    That's what I was suspecting, but I wasn't sure how to make a minimal repo with Vinxi + Civet only, because I wasn't sure how to use their FS router (I think their documentation is still a work in progress).

    Should I try and create a ticket in their repo, instead, @doeixd?

  4. joprice commented on Jun 19, 2024

    @joprice

    I think I hit the same issue here, where the vite-env-only plugin is not run early enough nksaraf/vinxi#298.

  5. brenelz commented on Jul 18, 2026

    @brenelz
    Contributor

    Does this still replicate in solid start v2 beta?

  6. birkskyum commented on Jul 25, 2026

    @birkskyum
    Member

    Closed as a SolidStart v1 issue. If this still exist in SolidStart v2, feel free to open with a refresh repro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Start 1.xbugSomething isn't workingvinxirelated to vinxi

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions