Closed zoechi closed 8 years ago
This is really a bug on the reflectable transformer. It expects to be able to see all files but that isn't always the case with pub serve. I don't think the tool
directory for instance gets served with just pub serve
.
I don't think the tool directory for instance gets served with just pub serve.
Right, didn't think of that because despite the warning the app works fine. I guess pub serve
just serves the files in tool
untranasformed.
interesting, I would have just expected it to not work at all
I was thinking more about it. pub serve
is started by WebStorm and I guess it knows that it has to start pub serve
with the tool
directory. Then we are back to square one, why does it print this message ;-)
Recall that pub serve
normally serves a single directory, by default it is just web
, but you can make it serve test
or other directories by calling pub serve dir
. Could it be that WebStorm is starting multiple pub-serve servers? What URL can you use to fetch the code under tool
when WebStorm launches pub-serve
in web
?
@alexander-doroshko might be able to shed some light. If WebStorm starts pub serve
for just one directory, the this would explain the message.
WebStorm starts a separate pub serve
process for each root folder requested by browser. So if files both from tool
and web
are queried then WebStorm starts 2 instances of pub serve
on different ports. You can see full information in Pub Serve tool window.
Note that normally in WebStorm you do not access pub serve
directly, so you never have its url and port in browser page address. Instead all requests are made to WebStorm internal web server (default port is 63342) that simply behaves as a proxy for pub serve
. For example in Pub Serve tool window you may see that there are 2 instances started:
pub serve web --port=65119
pub serve tool --port=56875
In browser you have URLs like this:
http://localhost:63342/ProjectName/web/foo.html
http://localhost:63342/ProjectName/tool/bar.html
WebStorm proxies first request to one instance of pub and the second one - to another. This is transparent to user, user doesn't have to know details about pub serve processes, their ports, etc.
That explains the message. Thanks @alexander-doroshko.
Hello all,
the reflectable transformer produces that Info message because it gets invoked with a barback settings object (which tells a transformer how pub was invoked) where an entry point is specified (e.g., 'web/index.dart'), but that entry point is not among the assets offered by pub to the transformer. So we are explicitly asked to work on that file, but it doesn't exist (as seen from the transformer). As Alexander explained, this could be because there are several pub processes, or simply because you have some entry points in 'web', but right now you are running pub build test
, so pub doesn't give us access to any of the entry points in 'web'.
We have kept the Info message in place because it seems dangerous to ignore requests for doing something specific ("please transform 'web/index.dart'") if it is not possible to do so. For instance, the problem could be caused by a misspelled entry point name, and that should not be ignored silently. However, we wish to run an alternate test: If we can simply check for the existence of the specified entry point (as a file on disk, not as an asset delivered by pub) then we can suppress the Info message.
For that, we need support from barback (currently we cannot obtain information about the root directory of the package currently being transformed---and it is not the current working directory of the pub process at the OS level---so we cannot check for the existence of a file given as a relative path from there). That's what https://github.com/dart-lang/reflectable/issues/17 is about.
:+1: thanks for the detailed explanation.
Hello again,
CL https://codereview.chromium.org/1448333004/ is a new iteration on this issue: It eliminates as many 'Missing entry point' messages as possible (namely the ones where we can verify that the file exists, it just wasn't offered by pub {build,serve} ..
to the transformer). It also allows for specifying 'suppressWarnings: missingEntryPoint' to eliminate all messages of that kind, and similarly for other warnings. The CL is included in commit https://github.com/dart-lang/reflectable/commit/2dc5e46ef6aa17daab9240a73f79fd7364c76193.
great :smiley:
pub serve
printsWhen I load a page from the
polymer_elements_demos
project (for exampleweb/index.html
Maybe related to the directory
tool
instead ofweb
This seems not to cause any harm, all seems working fine, still wondering if this needs some fix.