Skip to main content
Create new
Introduction
Reactivity
Props
Logic
Events
Bindings
Lifecycle
Stores
Motion
Transitions
Animations
Easing
SVG
Actions
Classes
Component composition
Context API
Special elements
Module context
Debugging
7GUIs
Miscellaneous
App.svelte
<script>
console.log(import.meta.url);
</script>

<p>
the URL is {import.meta.url}
</p>

Error compiling component

WebAssembly.instantiateStreaming(): value type opcode @+13
/* App.svelte generated by Svelte v3.26.0 */
import {
SvelteComponent,
detach,
element,
init,
insert,
noop,
safe_not_equal
} from "svelte/internal";

function create_fragment(ctx) {
let p;

return {
c() {
p = element("p");
p.textContent = `the URL is ${import.meta.url}`;
},
m(target, anchor) {
insert(target, p, anchor);
},
p: noop,
i: noop,
o: noop,
d(detaching) {
if (detaching) detach(p);
}
};
}

function instance($$self) {
console.log(import.meta.url);
return [];
}

result = svelte.compile(source, {
generate: ,
});
/* Add a <style> tag to see the CSS output */
		
			
				
  • {
    • html: Fragment {...}
      • start: 51
      • end: 89
      • type: "Fragment"
      • children: [...] (2)
        • Text {...}
          • start: 49
          • end: 51
          • type: "Text"
          • raw: "\n\n"
          • data: "\n\n"
          }
        • Element {...}
          • start: 51
          • end: 89
          • type: "Element"
          • name: "p"
          • attributes: []
          • children: [...] (3)
            • Text {...}
              • start: 54
              • end: 67
              • type: "Text"
              • raw: "\n\tthe URL is "
              • data: "\n\tthe URL is "
              }
            • MustacheTag {...}
              • start: 67
              • end: 84
              • type: "MustacheTag"
              • expression: MemberExpression {...}
                • type: "MemberExpression"
                • start: 68
                • end: 83
                • loc: {...}
                  • start: {...}
                    • line: 6
                    • column: 13
                    }
                  • end: {...}
                    • line: 6
                    • column: 28
                    }
                  }
                • object: MetaProperty {...}
                  • type: "MetaProperty"
                  • start: 68
                  • end: 79
                  • loc: {...}
                    • start: {...}
                      • line: 6
                      • column: 13
                      }
                    • end: {...}
                      • line: 6
                      • column: 24
                      }
                    }
                  • meta: Identifier {...}
                    • type: "Identifier"
                    • start: 68
                    • end: 74
                    • loc: {...}
                      • start: {...}
                        • line: 6
                        • column: 13
                        }
                      • end: {...}
                        • line: 6
                        • column: 19
                        }
                      }
                    • name: "import"
                    }
                  • property: Identifier {...}
                    • type: "Identifier"
                    • start: 75
                    • end: 79
                    • loc: {...}
                      • start: {...}
                        • line: 6
                        • column: 20
                        }
                      • end: {...}
                        • line: 6
                        • column: 24
                        }
                      }
                    • name: "meta"
                    }
                  }
                • property: Identifier {...}
                  • type: "Identifier"
                  • start: 80
                  • end: 83
                  • loc: {...}
                    • start: {...}
                      • line: 6
                      • column: 25
                      }
                    • end: {...}
                      • line: 6
                      • column: 28
                      }
                    }
                  • name: "url"
                  }
                • computed: false
                • optional: false
                }
              }
            • Text {...}
              • start: 84
              • end: 85
              • type: "Text"
              • raw: "\n"
              • data: "\n"
              }
            ]
          }
        ]
      }
    • css: undefined
    • instance: Script {...}
      • type: "Script"
      • start: 0
      • end: 49
      • context: "default"
      • content: Program {...}
        • type: "Program"
        • start: 8
        • end: 40
        • loc: {...}
          • start: {...}
            • line: 1
            • column: 0
            }
          • end: {...}
            • line: 3
            • column: 0
            }
          }
        • body: [...] (1)
          • ExpressionStatement {...}
            • type: "ExpressionStatement"
            • start: 10
            • end: 39
            • loc: {...}
              • start: {...}
                • line: 2
                • column: 1
                }
              • end: {...}
                • line: 2
                • column: 30
                }
              }
            • expression: CallExpression {...}
              • type: "CallExpression"
              • start: 10
              • end: 38
              • loc: {...}
                • start: {...}
                  • line: 2
                  • column: 1
                  }
                • end: {...}
                  • line: 2
                  • column: 29
                  }
                }
              • callee: MemberExpression {...}
                • type: "MemberExpression"
                • start: 10
                • end: 21
                • loc: {...}
                  • start: {...}
                    • line: 2
                    • column: 1
                    }
                  • end: {...}
                    • line: 2
                    • column: 12
                    }
                  }
                • object: Identifier {...}
                  • type: "Identifier"
                  • start: 10
                  • end: 17
                  • loc: {...}
                    • start: {...}
                      • line: 2
                      • column: 1
                      }
                    • end: {...}
                      • line: 2
                      • column: 8
                      }
                    }
                  • name: "console"
                  }
                • property: Identifier {...}
                  • type: "Identifier"
                  • start: 18
                  • end: 21
                  • loc: {...}
                    • start: {...}
                      • line: 2
                      • column: 9
                      }
                    • end: {...}
                      • line: 2
                      • column: 12
                      }
                    }
                  • name: "log"
                  }
                • computed: false
                • optional: false
                }
              • arguments: [...] (1)
                • MemberExpression {...}
                  • type: "MemberExpression"
                  • start: 22
                  • end: 37
                  • loc: {...}
                    • start: {...}
                      • line: 2
                      • column: 13
                      }
                    • end: {...}
                      • line: 2
                      • column: 28
                      }
                    }
                  • object: MetaProperty {...}
                    • type: "MetaProperty"
                    • start: 22
                    • end: 33
                    • loc: {...}
                      • start: {...}
                        • line: 2
                        • column: 13
                        }
                      • end: {...}
                        • line: 2
                        • column: 24
                        }
                      }
                    • meta: Identifier {...}
                      • type: "Identifier"
                      • start: 22
                      • end: 28
                      • loc: {...}
                        • start: {...}
                          • line: 2
                          • column: 13
                          }
                        • end: {...}
                          • line: 2
                          • column: 19
                          }
                        }
                      • name: "import"
                      }
                    • property: Identifier {...}
                      • type: "Identifier"
                      • start: 29
                      • end: 33
                      • loc: {...}
                        • start: {...}
                          • line: 2
                          • column: 20
                          }
                        • end: {...}
                          • line: 2
                          • column: 24
                          }
                        }
                      • name: "meta"
                      }
                    }
                  • property: Identifier {...}
                    • type: "Identifier"
                    • start: 34
                    • end: 37
                    • loc: {...}
                      • start: {...}
                        • line: 2
                        • column: 25
                        }
                      • end: {...}
                        • line: 2
                        • column: 28
                        }
                      }
                    • name: "url"
                    }
                  • computed: false
                  • optional: false
                  }
                ]
              • optional: false
              }
            }
          ]
        • sourceType: "module"
        }
      }
    • module: undefined
    }
The AST is not public API and may change at any point in time