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?]: yarn rw setup server-file fails with js but works with ts #10929

Closed
1 task
lintfail opened this issue Jul 9, 2024 · 5 comments
Closed
1 task

[Bug?]: yarn rw setup server-file fails with js but works with ts #10929

lintfail opened this issue Jul 9, 2024 · 5 comments
Assignees
Labels
bug/confirmed We have confirmed this is a bug topic/cli

Comments

@lintfail
Copy link

lintfail commented Jul 9, 2024

What's not working?

yarn rw setup server-file doesn't work with js but works with ts

How do we reproduce the bug?

yarn create redwood-app sample  #(not typescript)
cd sample
yarn install
yarn rw setup server-file

fails with

[STARTED] Adding the server file...
[FAILED] The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Promise
The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Promise

Seems to work fine if the project is ts

What's your environment? (If it applies)

System:
    OS: macOS 14.5
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 20.15.0 - /private/var/folders/z6/v_slqjb52537sk4256_bq7sm0000gn/T/xfs-0339140b/node
    Yarn: 4.3.0 - /private/var/folders/z6/v_slqjb52537sk4256_bq7sm0000gn/T/xfs-0339140b/yarn
  Databases:
    SQLite: 3.43.2 - /usr/bin/sqlite3
  Browsers:
    Chrome: 126.0.6478.127
    Safari: 17.5
  npmPackages:
    @redwoodjs/core: 7.7.2 => 7.7.2 
    @redwoodjs/project-config: 7.7.2 => 7.7.2 
  redwood.toml:
    [web]
      title = "Redwood App"
      port = 8910
      apiUrl = "/.redwood/functions" # You can customize graphql and dbauth urls individually too: see https://redwoodjs.com/docs/app-configuration-redwood-toml#api-paths
      includeEnvironmentVariables = [
        # Add any ENV vars that should be available to the web side to this array
        # See https://redwoodjs.com/docs/environment-variables#web
      ]
    [api]
      port = 8911
    [browser]
      open = true
    [notifications]
      versionUpdates = ["latest"]

Are you interested in working on this?

  • I'm interested in working on this
@lintfail lintfail added the bug/needs-info More information is needed for reproduction label Jul 9, 2024
@dac09
Copy link
Contributor

dac09 commented Jul 9, 2024

Thank you @lintfail for raising this - can confirm this bug!

@dac09 dac09 added bug/confirmed We have confirmed this is a bug and removed bug/needs-info More information is needed for reproduction labels Jul 9, 2024
@dac09 dac09 self-assigned this Jul 9, 2024
@lintfail
Copy link
Author

lintfail commented Jul 9, 2024

Thanks @dac09 is there a possible temp workaround while I wait for the fix? Mostly trying to get this file to integrate with BullMQ as outlined here https://community.redwoodjs.com/t/redwoodjs-v7-bullmq-bullboard/5790

@dac09
Copy link
Contributor

dac09 commented Jul 10, 2024

Hey hey, yes I'm prioritising looking at this today, so hope to have the fix published soon.

In the mean time work around is to do it manually.

  1. Create server.js at api/src/server.js
  2. Paste the content in as follows:
import { createServer } from '@redwoodjs/api-server'

import { logger } from 'src/lib/logger'

async function main() {
  const server = await createServer({
    logger,
  })

  await server.start()
}

main()
  1. Install the api server
yarn workspace api add @redwoodjs/api-server@7.7.2

^^^ the version here should be the same version as your project.

HTH!

@dac09 dac09 changed the title [Bug?]: yarn rw setup server-file doesn't work with js but works with ts [Bug?]: yarn rw setup server-file fails with js but works with ts Jul 10, 2024
Josh-Walker-GM added a commit that referenced this issue Jul 10, 2024
This PR waits all calls to `transformTSToJS` which became async due to
the prettier upgrade explained here:
#10762

Closes #10762
Closes #10929

---------

Co-authored-by: GitHub Actions <>
Co-authored-by: Josh GM Walker <56300765+Josh-Walker-GM@users.noreply.github.com>
Josh-Walker-GM added a commit that referenced this issue Jul 10, 2024
This PR waits all calls to `transformTSToJS` which became async due to
the prettier upgrade explained here:
#10762

Closes #10762
Closes #10929

---------

Co-authored-by: GitHub Actions <>
Co-authored-by: Josh GM Walker <56300765+Josh-Walker-GM@users.noreply.github.com>
@Josh-Walker-GM
Copy link
Collaborator

Josh-Walker-GM commented Jul 10, 2024

Hey all 👋 The fix for this was released in v7.7.3. If you could confirm that this new version fixes your problem that would be awesome!

@Josh-Walker-GM
Copy link
Collaborator

I ran through the reproduction steps on a v7.7.3 project and this appears to be fixed. Feel free to reopen if this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/confirmed We have confirmed this is a bug topic/cli
Projects
None yet
Development

No branches or pull requests

3 participants