Giter Club home page Giter Club logo

Comments (3)

grymmy avatar grymmy commented on September 14, 2024

Note that we are currently unable to provide 100% steps for reproduction here. (NEVERMIND! 3/27)

from sprig.

ryanrudes avatar ryanrudes commented on September 14, 2024

Here is a minimal procedure to reproduce the issue.

Consider the following example:

/*
First time? Check out the tutorial game:
https://sprig.hackclub.com/gallery/getting_started

@title: 
@author: 
@tags: []
@img: ""
@addedOn: 2024-00-00
*/

const player = "p"

setLegend(
  [ player, bitmap`...` ]
)

setSolids([])

let level = 0
const levels = [
  map`
p.
..`
]

setMap(levels[level])

setPushables({
  [ player ]: []
})

onInput("s", () => {
  getFirst(player).y += 1
})

afterInput(() => {
  
})
  1. Duplicate this line, without adding a separating comma
[ player, bitmap`...` ]
  1. Click Run. The editor appropriately raises a syntax error:
Error: The sprites passed into setLegend each need to be in square brackets, like setLegend([player, bitmap`...`]).
    at setLegend (index.78f90869.js:1:8965)
    at setLegend (index.78f90869.js:3120:12136)
    at eval (index.78f90869.js:14:1)
  1. Looking at the console events log, the backend also raises this error
editor.bde1f794.js:23 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'state')
    at editor.bde1f794.js:23:22531
    at Array.map (<anonymous>)
    at f1 (editor.bde1f794.js:23:22513)
    at editor.bde1f794.js:23:26806
    at p.x (signals.module.5a04f1ba.js:1:1208)
    at p.c (signals.module.5a04f1ba.js:1:3642)
    at $ (signals.module.5a04f1ba.js:1:312)
    at u.set (signals.module.5a04f1ba.js:1:1616)
    at Object.c [as onClick] (editor.bde1f794.js:268:6812)
    at Object.onClick (button.7ef0ffa5.js:8:108)
    at HTMLButtonElement.B (preact.module.3821bb68.js:1:4195)

Now, the map cannot be opened. I suspect that when this particular syntax error is present, once we click "Run", an autosave is attempted. This autosave likely fails, setting the value of some important property to null. When the modal popup view is then triggered, we try accessing a property of some null value, which prevents the map from opening in the future. It's not entirely clear to me which portion of the TypeScript source code the backend error provided in step 3 relates to (since it's fairly cryptic due to the JS compilation), but it may be a good idea to check this file for anything suspicious, as well as wherever the saving loop is implemented.

from sprig.

snoglobe avatar snoglobe commented on September 14, 2024

i get a different error:

Uncaught (in promise) TypeError: (destructured parameter) is undefined
    children map-editor.tsx:81
    MapEditor map-editor.tsx:81
    Preact 15
    debounceRendering debounceRendering.js:13
[map-editor.tsx:81:25](http://localhost:3000/src/components/subeditors/map-editor.tsx)
Uncaught (in promise) TypeError: ResizeObserver.observe: Argument 1 is not an object.
    MapEditor map-editor.tsx:58
    Preact 18
    debounceRendering debounceRendering.js:13
2 [map-editor.tsx:58:11](http://localhost:3000/src/components/subeditors/map-editor.tsx)
Uncaught (in promise) TypeError: ResizeObserver.observe: Argument 1 is not an object.
    MapEditor map-editor.tsx:58
    Preact 18
    debounceRendering debounceRendering.js:13
    promise callback*options.debounceRendering debounceRendering.js:11
    Preact 6
    onClick open-button.tsx:43
    I Preact
[map-editor.tsx:58:11](http://localhost:3000/src/components/subeditors/map-editor.tsx)

from sprig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.