dart-archive / stagehand

Dart project generator - web apps, console apps, servers, and more.
https://pub.dev/packages/stagehand
BSD 3-Clause "New" or "Revised" License
652 stars 118 forks source link

stagehand --web-simple Target of URI doesn't exist #677

Open npearson72 opened 4 years ago

npearson72 commented 4 years ago

Learning Dart and trying out stagehand for the first time.

I've built a project for the web using: stagehand --web-simple

My project structure is:

Screen Shot 2020-09-10 at 3 09 49 PM

But for some reason, import package is complaining it can't find it:

 [dart uri_does_not_exist] [E] Target of URI doesn't exist: 'package:tetris/tetris.dart' Try creating the file referenced by the URI, or Try using a URI for a file hat does exist.

This is what I have in my web/main.dart:

import 'package:tetris/tetris.dart';

void main() => Game().start();

This is in my lib/tetris.dart:

library tetris;

import 'dart:html';
import 'dart:async';
import 'dart:math';

part 'src/model/tile.dart';
part 'src/model/block.dart';
part 'src/model/blocks.dart';
part 'src/game.dart';

My pubspec.yml:

name: build_a_tetris_game
description: An absolute bare-bones web app.
# version: 1.0.0
#homepage: https://www.example.com

environment:
  sdk: '>=2.8.1 <3.0.0'

#dependencies:
#  path: ^1.7.0

dev_dependencies:
  build_runner: ^1.10.0
  build_web_compilers: ^2.11.0
  pedantic: ^1.9.0

Dart version:

Dart SDK version: 2.9.1 (stable) (Wed Aug 12 12:37:19 2020 +0200) on "macos_x64"

Any ideas?

sarahec commented 3 years ago

Your build.yaml says the package name is build_a_tetris_game. Change your import statement to import 'package:build_a_tetris_game/tetris.dart' and you should be golden.